I have an Errors class that I'm exporting using module.export
.
When I require the class in another file using const Errors = require('errors.js');
and then try and use throw Errors.NotImplimented
I get an undefined
error at the start of throw
.
If I try and console.log
the Errors class after requiring it I'm shown an empty object.
'use strict';
class Errors {
NotImplimented() {
return new Error('Not implimented');
}
HTTP_500() {
return new Error('500 Internal Server Error');
}
HTTP_404() {
return new Error('404 Page Not Found');
}
}
module.export = Errors;