Skip to content

Commit

Permalink
Removes onError additions from #99.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Harrison committed Oct 9, 2016
1 parent bc2ab7f commit 2bf0623
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions bin/micro
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ if ('/' !== file[0]) {
require('async-to-gen/register')

let mod
let onError

try {
mod = require(file);
onError = mod.onError
if (mod && 'object' === typeof mod) {
mod = mod.default;
}
Expand All @@ -73,14 +71,8 @@ if ('function' !== typeof mod) {
process.exit(1)
}

if ('function' !== typeof onError) {
onError = null
} else {
console.warn('[DEPRECATED] onError is deprecated and will be removed in a future release. Please use your own try/catch as needed.')
}

const { port, host } = args
serve(mod, { onError }).listen(port, host, err => {
serve(mod).listen(port, host, err => {
if (err) {
console.error('micro:', err.stack)
process.exit(1)
Expand Down

0 comments on commit 2bf0623

Please sign in to comment.