Skip to content

Commit

Permalink
Use the flash-supplied error messages for file loading errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tconkling committed Jun 19, 2012
1 parent 0afcf77 commit 68593c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions exporter/src/main/as/flump/export/FlaLoader.as
Expand Up @@ -55,8 +55,8 @@ public class FlaLoader
}
_loader.shutdown();
});
loadZip.failed.add(function (error :Object) :void {
_library.addTopLevelError(ParseError.CRIT, "Unable to read " + file.nativePath, error);
loadZip.failed.add(function (error :Error) :void {
_library.addTopLevelError(ParseError.CRIT, error.message, error);
_loader.shutdown();
});
}
Expand Down
9 changes: 4 additions & 5 deletions exporter/src/main/as/flump/export/XflLoader.as
Expand Up @@ -48,9 +48,8 @@ public class XflLoader
}
_loader.shutdown();
});
loadDomFile.failed.add(function (error :Object) :void {
_library.addTopLevelError(ParseError.CRIT, "Unable to read " + domFile.nativePath,
error);
loadDomFile.failed.add(function (error :Error) :void {
_library.addTopLevelError(ParseError.CRIT, error.message, error);
_loader.shutdown();
});
}
Expand All @@ -60,8 +59,8 @@ public class XflLoader
loadLibraryFile.succeeded.add(function (data :ByteArray) :void {
_library.parseLibraryFile(data, file.nativePath);
});
loadLibraryFile.failed.add(function (error :Object) :void {
_library.addTopLevelError(ParseError.CRIT, "Unable to read " + file.nativePath, error);
loadLibraryFile.failed.add(function (error :Error) :void {
_library.addTopLevelError(ParseError.CRIT, error.message, error);
});
}

Expand Down
8 changes: 4 additions & 4 deletions exporter/src/main/as/flump/xfl/XflLibrary.as
Expand Up @@ -145,13 +145,13 @@ public class XflLibrary
loadSwf.succeeded.add(function (loadedSwf :LoadedSwf) :void {
swf = loadedSwf;
});
loadSwf.failed.add(function (error :Object) :void {
addTopLevelError(ParseError.CRIT, "Unable to load " + path, error);
loadSwf.failed.add(function (error :Error) :void {
addTopLevelError(ParseError.CRIT, error.message, error);
});
loadSwf.completed.add(onComplete.succeed);
});
loadSwfFile.failed.add(function (error :Object) :void {
addTopLevelError(ParseError.CRIT, "Unable to read " + swfFile.nativePath, error);
loadSwfFile.failed.add(function (error :Error) :void {
addTopLevelError(ParseError.CRIT, error.message, error);
onComplete.fail(error);
});

Expand Down

0 comments on commit 68593c0

Please sign in to comment.