ansilove.js

A script to display ANSi and artscene related file formats on web pages
Log | Files | Refs | README | LICENSE

commit aa39a0d7cd03d1fa09041dd5ced0cb462039a916
parent 7df8f7e55b9e242ef9fbe8fdba179b7934984de1
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Fri,  8 Nov 2013 06:27:04 +0000

Only call callbackFail if it is passed.

Diffstat:
Mansilove.js | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -1722,7 +1722,11 @@ var AnsiLove = (function () { try { render(url, bytes, callback, 0, options || {}); } catch (e) { - callbackFail(e); + if (callbackFail) { + callbackFail(e); + } else { + throw e; + } } }, callbackFail); }, @@ -1731,7 +1735,11 @@ var AnsiLove = (function () { try { render(url, bytes, callback, splitRows || 27, options || {}); } catch (e) { - callbackFail(e); + if (callbackFail) { + callbackFail(e); + } else { + throw e; + } } }, callbackFail); },