|
|
|
@ -59,7 +59,8 @@ module.exports = function simpleSource(_options) {
|
|
|
|
|
if (errorReason === true) {
|
|
|
|
|
throw new Aborted("Stream was aborted");
|
|
|
|
|
} else if (errorReason instanceof Error) {
|
|
|
|
|
throw new Aborted(`Stream was aborted due to error: ${errorReason.message}`, {reason: errorReason});
|
|
|
|
|
// FIXME: Pass in full error, after changing to a different error type implementation that accepts error objects as extra properties
|
|
|
|
|
throw new Aborted(`Stream was aborted due to error: ${errorReason.message}`, {reason: errorReason.message});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return onRequest();
|
|
|
|
|