How to use the RestError function from restify

Find comprehensive JavaScript restify.RestError code examples handpicked from public code repositorys.

99
100
101
102
103
104
105
106
107
108

// ---- globals

var p = console.warn;
var fmt = util.format;
var RestError = restify.RestError;



// ---- exported functions
fork icon49
star icon182
watch icon65

+ 3 other calls in file

303
304
305
306
307
308
309
310
311
312

var restify = require('restify');
var util = require('util');

function MyError(message) {
  restify.RestError.call(this, {
    restCode: 'MyError'
    statusCode: 418,
    message: message,
    constructorOpt: MyError
fork icon18
star icon42
watch icon7

+ 15 other calls in file

18
19
20
21
22
23
24
25
26
27
28
29
30
 */


var util = require('util'),
    format = util.format;
var restify = require('restify'),
    RestError = restify.RestError;
var assert = require('assert-plus');




//---- globals
fork icon17
star icon5
watch icon0