import { App } from 'exseed';

class BasicApp extends App {
  /**
   * Setup environments like logging requests, create server, etc.
   * @param {object} app - the express app instance
   */
  constructor(app) {
    super(app);
  }

  /**
   * Setup routing rules
   * @param {object} app - the express app instance
   * @param {object} router - the express router
   * @param {object} models - all models of the project
   */
  routing(app, router, models) {
  }

  onError(err, req, res) {
    switch (err.name) {
      case 'PageNotFound': {
        res.status(err.status);
        res.send('404');
        break;
      }
    }
  }
};

export default BasicApp;
@@ -453,16 +453,110 @@
 dels) %7B%0A
+    app.get('/error', (req, res) =%3E %7B%0A      throw new Error('make error in purpose');%0A    %7D);%0A
   %7D%0A%0A  o
@@ -712,16 +712,267 @@
       %7D%0A
+      default: %7B%0A        console.log('==== Uncaught Exception ====');%0A        console.log(err.stack);%0A        console.log('============================');%0A        res.status(err.status %7C%7C 500);%0A        res.send('server error');%0A        break;%0A      %7D%0A
     %7D%0A  

Add uncaught error handling