Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: gin/function_template.h

Issue 798163002: Add failure messages to gin and js mojom encoder (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gin/function_template.h
diff --git a/gin/function_template.h b/gin/function_template.h
index 2b66b666ac8b76ed1dfa36686bab2d9eeac6650a..dff1bb2d7dce4f2e270efa62699eeb9ec2eee98b 100644
--- a/gin/function_template.h
+++ b/gin/function_template.h
@@ -131,8 +131,12 @@ struct ArgumentHolder {
ArgumentHolder(Arguments* args, int create_flags)
: ok(GetNextArgument(args, create_flags, index == 0, &value)) {
- if (!ok)
+ if (!ok) {
+ // Ideally we would include the expected c++ type in the error
+ // message which we can access via typeid(ArgType).name()
+ // however we compile with no-rtti, which disables typeid.
args->ThrowError();
+ }
}
};
« no previous file with comments | « gin/arguments.cc ('k') | mojo/public/js/codec.js » ('j') | mojo/public/js/codec.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698