summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2014-05-18 09:49:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-05-18 15:49:19 (GMT)
commitfa8fd85f5c451648bb7cfbe275db19efa921d850 (patch)
tree54adc28feceef0f674fb69088effbb975e76cc1a /Sluift/Response.cpp
parent1165b03c019a2207dc58a2070b1d5ff5833b8093 (diff)
downloadswift-contrib-fa8fd85f5c451648bb7cfbe275db19efa921d850.zip
swift-contrib-fa8fd85f5c451648bb7cfbe275db19efa921d850.tar.bz2
Sluift: Add assertions on conversion
Change-Id: I641380fe7423af7b2c7be992f59244a57fb24b51
Diffstat (limited to 'Sluift/Response.cpp')
-rw-r--r--Sluift/Response.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Sluift/Response.cpp b/Sluift/Response.cpp
index 519379c..5c36a8e 100644
--- a/Sluift/Response.cpp
+++ b/Sluift/Response.cpp
@@ -27,52 +27,54 @@ static std::string getErrorString(boost::shared_ptr<ErrorPayload> error) {
case ErrorPayload::BadRequest: return "Bad request";
case ErrorPayload::Conflict: return "Conflict";
case ErrorPayload::FeatureNotImplemented: return "This feature is not implemented";
case ErrorPayload::Forbidden: return "Forbidden";
case ErrorPayload::Gone: return "Recipient can no longer be contacted";
case ErrorPayload::InternalServerError: return "Internal server error";
case ErrorPayload::ItemNotFound: return "Item not found";
case ErrorPayload::JIDMalformed: return "JID Malformed";
case ErrorPayload::NotAcceptable: return "Message was rejected";
case ErrorPayload::NotAllowed: return "Not allowed";
case ErrorPayload::NotAuthorized: return "Not authorized";
case ErrorPayload::PaymentRequired: return "Payment is required";
case ErrorPayload::RecipientUnavailable: return "Recipient is unavailable";
case ErrorPayload::Redirect: return "Redirect";
case ErrorPayload::RegistrationRequired: return "Registration required";
case ErrorPayload::RemoteServerNotFound: return "Recipient's server not found";
case ErrorPayload::RemoteServerTimeout: return "Remote server timeout";
case ErrorPayload::ResourceConstraint: return "The server is low on resources";
case ErrorPayload::ServiceUnavailable: return "The service is unavailable";
case ErrorPayload::SubscriptionRequired: return "A subscription is required";
case ErrorPayload::UndefinedCondition: return "Undefined condition";
case ErrorPayload::UnexpectedRequest: return "Unexpected request";
}
}
assert(false);
return defaultMessage;
}
Response::~Response() {
}
int Response::convertToLuaResult(lua_State* L) {
if (error) {
lua_pushnil(L);
lua_pushstring(L, getErrorString(error).c_str());
- Sluift::globals.elementConvertor.convertToLuaUntyped(L, error);
+ bool converted = Sluift::globals.elementConvertor.convertToLuaUntyped(L, error);
+ assert(converted);
Lua::registerTableToString(L, -1);
return 3;
}
else {
if (result) {
- Sluift::globals.elementConvertor.convertToLuaUntyped(L, result);
+ bool converted = Sluift::globals.elementConvertor.convertToLuaUntyped(L, result);
+ assert(converted);
Lua::registerTableToString(L, -1);
}
else {
lua_pushboolean(L, 1);
}
return 1;
}
}