Skip to content

Commit

Permalink
fix: incorrect error message (#383)
Browse files Browse the repository at this point in the history
* fix error message

* fix more error messages

* correct docstring
  • Loading branch information
BalduinLandolt authored Feb 20, 2023
1 parent 790e208 commit 94b50f9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/SipiHttpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ namespace Sipi {
file_path_param->value.s = filepath;
lvals.push_back(file_path_param);

// The third parameter is the HTTP cookie.
// The second parameter is the HTTP cookie.
std::shared_ptr<LuaValstruct> cookie_param = std::make_shared<LuaValstruct>();
std::string cookie = conn_obj.header("cookie");
cookie_param->type = LuaValstruct::STRING_TYPE;
Expand All @@ -345,7 +345,7 @@ namespace Sipi {
// If it returned nothing, that's an error.
if (rvals.empty()) {
std::ostringstream err_msg;
err_msg << "Lua function " << iiif_preflight_funcname << " must return at least one value";
err_msg << "Lua function " << file_preflight_funcname << " must return at least one value";
throw SipiError(__file__, __LINE__, err_msg.str());
}

Expand All @@ -363,7 +363,7 @@ namespace Sipi {
}
catch (const std::out_of_range &err) {
std::ostringstream err_msg;
err_msg << "The permission value returned by Lua function " << iiif_preflight_funcname << " has no type field!";
err_msg << "The permission value returned by Lua function " << file_preflight_funcname << " has no type field!";
throw SipiError(__file__, __LINE__, err_msg.str());
}
if (tmpv->type != LuaValstruct::STRING_TYPE) {
Expand All @@ -381,7 +381,7 @@ namespace Sipi {
}
else {
std::ostringstream err_msg;
err_msg << "The permission value returned by Lua function " << iiif_preflight_funcname << " was not valid";
err_msg << "The permission value returned by Lua function " << file_preflight_funcname << " was not valid";
throw SipiError(__file__, __LINE__, err_msg.str());
}

Expand All @@ -394,7 +394,7 @@ namespace Sipi {
(preflight_info["type"] != "deny"))
{
std::ostringstream err_msg;
err_msg << "The permission returned by Lua function " << iiif_preflight_funcname << " is not valid: " << preflight_info["type"];
err_msg << "The permission returned by Lua function " << file_preflight_funcname << " is not valid: " << preflight_info["type"];
throw SipiError(__file__, __LINE__, err_msg.str());
}

Expand All @@ -404,7 +404,7 @@ namespace Sipi {
else {
if (rvals.size() < 2) {
std::ostringstream err_msg;
err_msg << "Lua function " << iiif_preflight_funcname
err_msg << "Lua function " << file_preflight_funcname
<< " returned other permission than 'deny', but it did not return a file path";
throw SipiError(__file__, __LINE__, err_msg.str());
}
Expand All @@ -417,7 +417,7 @@ namespace Sipi {
}
else {
std::ostringstream err_msg;
err_msg << "The file path returned by Lua function " << iiif_preflight_funcname << " was not a string";
err_msg << "The file path returned by Lua function " << file_preflight_funcname << " was not a string";
throw SipiError(__file__, __LINE__, err_msg.str());
}
}
Expand Down

0 comments on commit 94b50f9

Please sign in to comment.