ansilove.js

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

commit fdb361de78c415bc7775b6c7d1cceaea1126fbcf
parent 6317bc74cc5492061ab3b2e585010d3c9c90cdb9
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Fri, 18 Oct 2013 18:46:22 +0100

Added http status code when returning an error.

Diffstat:
MREADME.md | 6+++---
Mansilove.js | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -68,12 +68,12 @@ And for ANSImations, the animate function returns a controller object which when }); }, {"bits": "9"}); -If a function is passed after the options object of any method, then it will be called in the event that the file cannot be fetched: +If a function is passed after the options object of any method, then it will be called in the event that the file cannot be fetched with the http status code. AnsiLove.render("example.ans", function (canvas, sauce) { ... - }, {}, function () { - alert("An error occured."); + }, {}, function (httpStatus) { + alert("A " + httpStatus + " error occured."); }); ### PC font options: diff --git a/ansilove.js b/ansilove.js @@ -1020,7 +1020,7 @@ var AnsiLove = (function () { break; default: if (callbackFail) { - callbackFail(); + callbackFail(http.status); } else { throw ("Could not retrieve: " + url); }