-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exceptions from AvisynthPluginInit3()
not displayed!
#315
Comments
This is how you imagined? When an Avs26-style plugin throws an Avisynth exception during AvisynthPluginInit3, then I can catch the error string. My prepared
I added the exception text after the usual message: old: new one:
|
Yes, this is what I was referring to. The line could get a bit long, though. Am I right that AviSynth avoids having anything other than a file reference with line and column in the second error message line? But anyone can violate that and use a line break in their messages anyway. I'm not sure it would be best to have the text If the plugin threw something unrecognizable, the message should be identical to the present one, probably just with a period for more consistency. (Or use a generic addition, if you have an idea. But is it that it shouldn't talk about exceptions?) |
See commit 78c0d9f |
What about long lines? Are you opposed to write In case of // Message could be from plugin author or, e.g., from env->AddFunction() |
Commit 78c0d9f leftover (issue AviSynth#315).
When
env->ThrowError()
is used or anAvisynthError
is thrown inAvisynthPluginInit3()
, there's only the message"'%s' cannot be used as a plugin for AviSynth."
.Even
env->AddFunction()
though, that'll always be called inAvisynthPluginInit3()
, may throw"%s has an invalid parameter string (bug in filter)"
(seePluginManager.cpp
). It would definitely be useful to be able to read that message during development. But the way things are, this message will practically never be shown.In my Rust crate that can be used to write plugins, I also let a plugin author return an error string from the plugin init function the same way it's possible with a plugin function (that can be called from an .avs script). Returning an error string from a plugin function gives the nice typical red error text containing the string. This should also be possible with the plugin init function. There are also errors my crate handles for the plugin author, like insufficient AviSynth+ interface version with the request to the user to update their AviSynth+ installation. So, some error strings from the plugin init function are from my crate, others can be from the plugin author.
Suggestion
When loading a plugin, please catch
AvisynthError
s (besides the already existingcatch (...)
with literal dots) and append the thrown message as a second line or otherwise to "...cannot be used as a plugin..."The text was updated successfully, but these errors were encountered: