Bug 54971 - Web Inspector: it should be possible to pass custom error text from a backend method to frontend.
Summary: Web Inspector: it should be possible to pass custom error text from a backend...
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: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 10:33 PST by Ilya Tikhonovsky
Modified: 2011-02-24 04:03 PST (History)
10 users (show)

See Also:


Attachments
[patch] initial version (81.19 KB, patch)
2011-02-22 10:35 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
[patch] second version. (83.46 KB, patch)
2011-02-24 01:33 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2011-02-22 10:33:11 PST
Each command response should have boolean success and string error message as in protocol above.
Comment 1 Ilya Tikhonovsky 2011-02-22 10:35:55 PST
Created attachment 83339 [details]
[patch] initial version
Comment 2 Pavel Feldman 2011-02-22 10:58:10 PST
Comment on attachment 83339 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=83339&action=review

> Source/WebCore/inspector/InspectorAgent.h:204
> +    void enableProfiler(InspectorArray* errors = 0);

I understand that the protocol layer allows multiple errors, but the user layer is used to returning an error message (single string).

> Source/WebCore/inspector/InspectorAgent.h:205
> +    void disableProfiler(InspectorArray* errors = 0);

You force methods to check for errors existence - not nice.
Comment 3 Ilya Tikhonovsky 2011-02-24 01:33:53 PST
Created attachment 83620 [details]
[patch] second version.

This version uses String* as the placeholder for the error text.
Comment 4 Pavel Feldman 2011-02-24 02:06:18 PST
Comment on attachment 83620 [details]
[patch] second version.

View in context: https://bugs.webkit.org/attachment.cgi?id=83620&action=review

One thing would improve this change: if you could replace String* with ErrorString* and accompany it with typedef String ErrorString, that would improve error handling visibility to the agent authors.

> Source/WebCore/ChangeLog:5
> +        Web Inspector: There is a validator of the protocol message format.

Please add bug url into the changelog.

> Source/WebCore/ChangeLog:19
> +        * inspector/InjectedScriptHost.cpp:

Not sure you need it all here, I would leave names of the files only.
Comment 5 Ilya Tikhonovsky 2011-02-24 03:44:08 PST
Committed r79539
	M	Source/WebCore/ChangeLog
	M	Source/WebCore/inspector/InspectorRuntimeAgent.h
	M	Source/WebCore/inspector/InspectorDebuggerAgent.h
	M	Source/WebCore/inspector/CodeGeneratorInspector.pm
	M	Source/WebCore/inspector/InspectorCSSAgent.h
	M	Source/WebCore/inspector/InjectedScriptHost.cpp
	M	Source/WebCore/inspector/InspectorController.cpp
	M	Source/WebCore/inspector/InspectorTimelineAgent.cpp
	M	Source/WebCore/inspector/InspectorConsoleAgent.h
	M	Source/WebCore/inspector/InspectorDatabaseAgent.h
	M	Source/WebCore/inspector/InspectorAgent.cpp
	M	Source/WebCore/inspector/InspectorProfilerAgent.cpp
	M	Source/WebCore/inspector/InspectorRuntimeAgent.cpp
	M	Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp
	M	Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
	M	Source/WebCore/inspector/InspectorTimelineAgent.h
	M	Source/WebCore/inspector/InspectorProfilerAgent.h
	M	Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h
	M	Source/WebCore/inspector/InspectorDOMStorageAgent.h
	M	Source/WebCore/inspector/InspectorDOMAgent.h
	M	Source/WebCore/inspector/InspectorDebuggerAgent.cpp
	M	Source/WebCore/inspector/InspectorCSSAgent.cpp
	M	Source/WebCore/inspector/InspectorApplicationCacheAgent.h
	M	Source/WebCore/inspector/InspectorResourceAgent.h
	M	Source/WebCore/inspector/InspectorConsoleAgent.cpp
	M	Source/WebCore/inspector/InspectorDatabaseAgent.cpp
	M	Source/WebCore/inspector/InspectorDOMAgent.cpp
	M	Source/WebCore/inspector/InspectorAgent.h
	M	Source/WebCore/inspector/InspectorResourceAgent.cpp
	M	Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
r79539 = df5982d5c9853446953cbb1b35c1c1986a2a9830 (refs/remotes/trunk)
Comment 6 Ilya Tikhonovsky 2011-02-24 04:03:26 PST
build fix

Committed r79542
	M	Source/WebCore/ChangeLog
	M	Source/WebCore/inspector/InspectorRuntimeAgent.cpp
	M	Source/WebCore/inspector/InspectorDOMAgent.cpp
	M	Source/WebCore/inspector/InspectorResourceAgent.cpp
r79542 = 6e8066bfb8a0ea75b42df82b0ec0da2857fc8996 (refs/remotes/trunk)