Skip to content
Snippets Groups Projects
Commit 39f15ed2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Better error reporting to help root-caues Nelgin's problem using bccnews.js

<nelgin> !JavaScript : uncaught exception: Unknown scheme! 'undefined'
<nelgin> (error with no line number) is the worst.
parent c0f433f7
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ HTTPRequest.prototype.SetupGet=function(url, referer, base) {
this.base=base;
this.url=new URL(url, this.base);
if(this.url.scheme!='http' && this.url.scheme!='https')
throw("Unknown scheme! '"+this.url.scheme+"'");
throw new Error("Unknown scheme! '"+this.url.scheme+"' in url:" + url);
if(this.url.path=='')
this.url.path='/';
this.request="GET "+this.url.request_path+" HTTP/1.0";
......@@ -77,7 +77,7 @@ HTTPRequest.prototype.SetupPost=function(url, referer, base, data, content_type)
this.base=base;
this.url=new URL(url, this.base);
if(this.url.scheme!='http' && this.url.scheme!='https')
throw("Unknown scheme! '"+this.url.scheme+"'");
throw new Error("Unknown scheme! '"+this.url.scheme+"' in url: " + url);
if(this.url.path=='')
this.url.path='/';
this.request="POST "+this.url.request_path+" HTTP/1.0";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment