Skip to content

Commit 505e3ca

Browse files
committed
fix error message handling.
1 parent e82e782 commit 505e3ca

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/VapourSource.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void VapourSource::validate(bool cond, std::string msg)
230230
{
231231
if (cond) {
232232
destroy();
233-
throw msg.c_str();
233+
throw msg;
234234
}
235235
}
236236

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

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

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

0 commit comments

Comments
 (0)