Bug 42873 - Web Inspector: error info propagation in InspectorBackendDispatch should be improved
Summary: Web Inspector: error info propagation in InspectorBackendDispatch should be i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-23 00:00 PDT by Ilya Tikhonovsky
Modified: 2010-07-23 04:59 PDT (History)
9 users (show)

See Also:


Attachments
Patch (4.61 KB, patch)
2010-07-23 02:23 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff
InspectorBackendDispatcher.cpp (56.75 KB, application/octet-stream)
2010-07-23 02:39 PDT, Yury Semikhatsky
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2010-07-23 00:00:20 PDT
it would be better to push a detailed error description back 
to the caller if some argument required by function spec is missed or has incorrect type.
Comment 1 Yury Semikhatsky 2010-07-23 02:23:03 PDT
Created attachment 62398 [details]
Patch
Comment 2 Ilya Tikhonovsky 2010-07-23 02:36:38 PDT
Comment on attachment 62398 [details]
Patch


WebCore/inspector/CodeGeneratorInspector.pm:245
 +      push(@function, "    if (args->length() != " . $expectedParametersCount . ") {");

can be simplified a bit.
push(@function, "    if (args->length() != $expectedParametersCount) {");


WebCore/inspector/CodeGeneratorInspector.pm:246
 +      push(@function, "        *exception = String::format(\"Wrong number of parameters: %d (expected: $expectedParametersCount)\", args->length());");
It would be better to also print the parameter name.
Comment 3 Yury Semikhatsky 2010-07-23 02:39:45 PDT
Created attachment 62399 [details]
InspectorBackendDispatcher.cpp
Comment 4 Yury Semikhatsky 2010-07-23 04:59:08 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/CodeGeneratorInspector.pm
Committed r63962
Comment 5 Yury Semikhatsky 2010-07-23 04:59:28 PDT
(In reply to comment #2)
> (From update of attachment 62398 [details])
> 
> WebCore/inspector/CodeGeneratorInspector.pm:245
>  +      push(@function, "    if (args->length() != " . $expectedParametersCount . ") {");
> 
> can be simplified a bit.
> push(@function, "    if (args->length() != $expectedParametersCount) {");
> 
> 
> WebCore/inspector/CodeGeneratorInspector.pm:246
>  +      push(@function, "        *exception = String::format(\"Wrong number of parameters: %d (expected: $expectedParametersCount)\", args->length());");
> It would be better to also print the parameter name.

All comments have been addressed.