Bug 42873

Summary: Web Inspector: error info propagation in InspectorBackendDispatch should be improved
Product: WebKit Reporter: Ilya Tikhonovsky <loislo>
Component: Web Inspector (Deprecated)Assignee: Yury Semikhatsky <yurys>
Status: RESOLVED FIXED    
Severity: Normal CC: bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
pfeldman: review+
InspectorBackendDispatcher.cpp none

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.