Skip to content

Commit

Permalink
classlib: If error thrown during initClassTree then post normal raw e…
Browse files Browse the repository at this point in the history
  • Loading branch information
crucialfelix committed Jun 27, 2016
1 parent 47ebe05 commit bb7f7be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/supercollider-js/SuperColliderJS.sc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ SuperColliderJS {
^out
}

*isInitialized {
^errorEncoders.notNil
}

*initClass {
tab = [$\\,$\\,$t].as(String);
nl = [$\\,$\\,$n].as(String);
Expand Down
7 changes: 7 additions & 0 deletions src/supercollider-js/SystemOverwrites/plusError.sc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@

+ Exception {
reportError {
if (SuperColliderJS.isInitialized.not, {
"Class Library failed to initialize".error;
this.errorString.postln;
if(protectedBacktrace.notNil, { this.postProtectedBacktrace });
this.dumpBackTrace;
this.halt;
});
{
var error = SuperColliderJS.encodeError(this, true, nil);
SuperColliderJS.return("0", "Error", error);
Expand Down

0 comments on commit bb7f7be

Please sign in to comment.