From 791a0eb360cd9486ea03ac2e734f2ce03aa81cfb Mon Sep 17 00:00:00 2001 From: "Cathy J. Fitzpatrick" Date: Mon, 15 Apr 2013 18:21:26 -0600 Subject: [PATCH] Add an error callback to battle.js --- js/battle.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/battle.js b/js/battle.js index d43569cc8..4e2b86e93 100644 --- a/js/battle.js +++ b/js/battle.js @@ -4184,6 +4184,7 @@ function Battle(frame, logFrame, noPreload) { default: self.logConsole('Unknown minor: ' + args[0]); + if (self.errorCallback) self.errorCallback(self); break; } } @@ -4690,6 +4691,7 @@ function Battle(frame, logFrame, noPreload) { default: self.logConsole('unknown command: ' + args[0]); self.log('
Unknown command: ' + Tools.escapeHTML(args[0]) + '
'); + if (self.errorCallback) self.errorCallback(self); break; } }; @@ -4751,6 +4753,7 @@ function Battle(frame, logFrame, noPreload) { } else { self.log('
Error: ' + Tools.escapeHTML(''+e) + '
', preempt); } + if (self.errorCallback) self.errorCallback(self); } } else { self.log('
' + Tools.escapeHTML(str) + '
', preempt); @@ -4972,6 +4975,7 @@ function Battle(frame, logFrame, noPreload) { this.stagnateCallback = null; this.endCallback = null; this.customCallback = null; + this.errorCallback = null; // external this.resumeButton = this.play;