mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Changed all error handling to async-stacktrace style + fixed import/export on unix
This commit is contained in:
parent
db1ba6a65e
commit
5c56e62d67
18 changed files with 325 additions and 352 deletions
|
@ -17,6 +17,7 @@
|
|||
var async = require("async");
|
||||
var Changeset = require("./Changeset");
|
||||
var padManager = require("../db/PadManager");
|
||||
var ERR = require("async-stacktrace");
|
||||
|
||||
function getPadPlainText(pad, revNum)
|
||||
{
|
||||
|
@ -58,8 +59,9 @@ function getPadHTML(pad, revNum, callback)
|
|||
{
|
||||
pad.getInternalRevisionAText(revNum, function (err, revisionAtext)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
atext = revisionAtext;
|
||||
callback(err);
|
||||
callback();
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -81,7 +83,8 @@ function getPadHTML(pad, revNum, callback)
|
|||
|
||||
function (err)
|
||||
{
|
||||
callback(err, html);
|
||||
if(ERR(err, callback)) return;
|
||||
callback(null, html);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -410,11 +413,7 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
|
|||
{
|
||||
padManager.getPad(padId, function (err, pad)
|
||||
{
|
||||
if (err)
|
||||
{
|
||||
callback(err);
|
||||
return;
|
||||
}
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
var head = (noDocType ? '' : '<!doctype html>\n') + '<html lang="en">\n' + (noDocType ? '' : '<head>\n' + '<meta charset="utf-8">\n' + '<style> * { font-family: arial, sans-serif;\n' + 'font-size: 13px;\n' + 'line-height: 17px; }</style>\n' + '</head>\n') + '<body>';
|
||||
|
||||
|
@ -422,7 +421,8 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback)
|
|||
|
||||
getPadHTML(pad, revNum, function (err, html)
|
||||
{
|
||||
callback(err, head + html + foot);
|
||||
if(ERR(err, callback)) return;
|
||||
callback(null, head + html + foot);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue