Don't attempt symbolicating non-http(s) urls

Summary:
Looks like spaces in function names can happen, but the lib we use for parsing stacktraces doesn't support that. As result, when error is thrown in global scope, new JSC puts "global code" as function name, our parser chokes on it and thinks "global code@http://...." is a file name and sends it to packager. The packager can't resolve that URL and fails the whole symbolication request.

Longer term fix here: https://github.com/errwischt/stacktrace-parser/pull/5

Reviewed By: astreet

Differential Revision: D3516741

fbshipit-source-id: 4f2bb70084437ed9d37495cd775622a8c981fad1
This commit is contained in:
Alex Kotliarskyi 2016-07-05 09:37:00 -07:00 committed by Facebook Github Bot 2
parent ed0b6b1ef5
commit 8b00d98167
1 changed files with 3 additions and 1 deletions

View File

@ -499,8 +499,10 @@ class Server {
const sourceUrl = frame.file; const sourceUrl = frame.file;
// Skip `/debuggerWorker.js` which drives remote debugging because it // Skip `/debuggerWorker.js` which drives remote debugging because it
// does not need to symbolication. // does not need to symbolication.
// Skip anything except http(s), because there is no support for that yet
if (!urlIndexes.hasOwnProperty(sourceUrl) && if (!urlIndexes.hasOwnProperty(sourceUrl) &&
!sourceUrl.endsWith('/debuggerWorker.js')) { !sourceUrl.endsWith('/debuggerWorker.js') &&
sourceUrl.startsWith('http')) {
urlIndexes[sourceUrl] = uniqueUrls.length; urlIndexes[sourceUrl] = uniqueUrls.length;
uniqueUrls.push(sourceUrl); uniqueUrls.push(sourceUrl);
} }