Closed Bug 1196776 Opened 9 years ago Closed 9 years ago

Server side logging: adding observer throws an exception

Categories

(DevTools :: Console, defect)

42 Branch
defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: Honza, Unassigned)

Details

Attachments

(1 file)

I am seeing the following exception when opening Browser Content Toolbox:

Handler function threw an exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIObserverService.addObserver]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/toolkit/webconsole/server-logger.js :: ServerLoggingListener<.attach< :: line 91"  data: no]


It's related to this code:

if (DebuggerServer.isInChildProcess) {
  this.attachParentProcess();
} else {
  Services.obs.addObserver(this.onExamineResponse,
    "http-on-examine-response", false);
}


The DebuggerServer.isInChildProcess is set to false and Services.obs.addObserver throws NS_ERROR_NOT_IMPLEMENTED exception.

Honza
Alex, even if the DebuggerServer.isInChildProcess is false, it looks like we are in the child process here, no?

Honza
Flags: needinfo?(poirot.alex)
Yes. It looks like we never supported this (dynamic actors and related api) in the browser content toolbox.
Flags: needinfo?(poirot.alex)
Attached patch patch v1Splinter Review
https://treeherder.mozilla.org/#/jobs?repo=try&revision=46225888c51c

It would be great to have one single test against browser (content) toolbox...

Honza, Does server-loger works correctly with that or isn't that enough?
This fixes the exception, thanks.

However, I am not sure what is the use case for server-side-logging here.

Is the Browser Content Toolbox (the Console panel) expecting to show server side logs coming from all pages? This doesn't work now.

I've been testing XHR and it doesn't work either, is it a bug?

console API calls seems to appear in the browser content console...

Honza
Flags: needinfo?(poirot.alex)
(In reply to Jan Honza Odvarko [:Honza] from comment #4)
> This fixes the exception, thanks.
> 
> However, I am not sure what is the use case for server-side-logging here.

At least, this patch ensure that actor-actor works in browser content toolbox.
server-side-logging may not be the only thing use isInChildProcess/parentMessageManager API.

> Is the Browser Content Toolbox (the Console panel) expecting to show server
> side logs coming from all pages? This doesn't work now.

I can easily imagine messages not being routed correctly within server-loger.js or server-loger-monitor.js... but that's a different issue than this exception.
I don't think it is critical to support server-side-logging in this particular context.
Flags: needinfo?(poirot.alex)
Yes, agreed.

So, the attached patch solves this bug report.

Thanks!
Honza
Comment on attachment 8650514 [details] [diff] [review]
patch v1

Oh I forgot to r? this patch...
Attachment #8650514 - Flags: review?(jryans)
https://hg.mozilla.org/mozilla-central/rev/1d9a8a4f79b9
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 43
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: