Better error message when importing file that is not found

This commit is contained in:
Martin Carlberg committed 2012-12-20 14:23:54 +01:00
1 parent 227c696750
commit 26be5bf264
2 files changed
+7 -1

No files matched your search

+4 -1
View File
@@ -496,7 +496,10 @@ Executable.fileExecutableSearcherForURL = function(/*CFURL*/ referenceURL)
function completed(/*StaticResource*/ aStaticResource)
{
if (!aStaticResource)
throw new Error("Could not load file at " + aURL);
{
var compilingFileUrl = ObjJCompiler && ObjJCompiler.currentCompileFile ? ObjJCompiler.currentCompileFile : null;
throw new Error("Could not load file at " + aURL + (compilingFileUrl ? " when compiling " + compilingFileUrl : " Martin"));
}
cachedFileExecutableSearchResults[cacheUID] = aStaticResource;
+3
View File
@@ -25,6 +25,7 @@ var ObjJCompiler = { },
exports.compileToExecutable = function(/*String*/ aString, /*CFURL*/ aURL, /*unsigned*/ flags)
{
ObjJCompiler.currentCompileFile = aURL;
return new ObjJCompiler(aString, aURL, flags, 2).executable();
}
@@ -35,6 +36,7 @@ exports.compileToIMBuffer = function(/*String*/ aString, /*CFURL*/ aURL, /*unsig
exports.compileFileDependencies = function(/*String*/ aString, /*CFURL*/ aURL, /*unsigned*/ flags)
{
ObjJCompiler.currentCompileFile = aURL;
return new ObjJCompiler(aString, aURL, flags, 1).executable();
}
@@ -87,6 +89,7 @@ var ObjJCompiler = function(/*String*/ aString, /*CFURL*/ aURL, /*unsigned*/ fla
ObjJCompiler.prototype.compilePass2 = function()
{
ObjJCompiler.currentCompileFile = this._URL;
this._pass = 2;
this._jsBuffer = new StringBuffer();
//print("Start Compile2: " + this._URL);