Skip to content

Commit

Permalink
fix error message handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
chikuzen committed May 7, 2016
1 parent e82e782 commit 505e3ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/VapourSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void VapourSource::validate(bool cond, std::string msg)
{
if (cond) {
destroy();
throw msg.c_str();
throw msg;
}
}

Expand Down Expand Up @@ -259,7 +259,7 @@ VapourSource(const char* source, bool stacked, int index, const char* m,
if (ret != 0) {
auto msg = string("failed to evaluate script.\n") + vsscript_getError(se);
destroy();
throw msg.c_str();
throw msg;
}
}

Expand All @@ -270,7 +270,7 @@ VapourSource(const char* source, bool stacked, int index, const char* m,
if (ret != 0) {
auto msg = string("failed to evaluate script.\n") + vsscript_getError(se);
destroy();
throw msg.c_str();
throw msg;
}
}

Expand Down Expand Up @@ -340,8 +340,8 @@ create_vapoursource(AVSValue args, void* user_data, IScriptEnvironment* env)
try {
return new VapourSource(args[0].AsString(), args[1].AsBool(false),
args[2].AsInt(0), mode, env);
} catch (const char* e) {
env->ThrowError("%s: %s", mode, e);
} catch (std::string e) {
env->ThrowError("%s: %s", mode, e.c_str());
}
return 0;
}
Expand Down

0 comments on commit 505e3ca

Please sign in to comment.