Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mvcjs

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mvcjs - npm Package Compare versions

Comparing version 0.1.0-beta-5 to 0.1.0-beta-6

33

framework/core/request.js

@@ -305,11 +305,4 @@ "use strict";

_handleError: function Request_handleError(response) {
var Controller,
errorRoute = router.getErrorRoute(),
errorController = '@{controllersPath}/' + errorRoute.shift(),
errorAction = errorRoute.shift();
if (response instanceof Error && !this.isERROR && di.exists(di.normalizePath(errorController) + '.js')) {
if (response instanceof Error && !this.isERROR && !!router.getErrorRoute()) {
if (response.code) {

@@ -320,24 +313,4 @@ this.statusCode = response.code;

}
try {
Controller = di.load(errorController);
errorController = new Controller();
if (errorController.has('action_' + errorAction)) {
response = errorController.get('action_' + errorAction).call(errorController, response);
if (response.trace) {
this._render(response.trace);
} else if (response.stack) {
this._render(response.stack);
} else {
this._render(response);
}
} else {
throw new error.HttpError(500, {errorAction: errorAction}, "No error action defined at error controller");
}
} catch (e) {
this.isERROR = true;
throw new error.HttpError(500, {}, "Error on executing error action", e);
}
this.isERROR = true;
return this._resolveRoute([router.getErrorRoute(), response]).then(null, this._handleError);
} else if (response.trace) {

@@ -344,0 +317,0 @@ this.addHeader('Content-Type', 'text/plain');

8

framework/core/router.js

@@ -30,8 +30,4 @@ "use strict";

this.config = core.extend({
errorRoute: "error/index"
errorRoute: false
}, config);
if (!Type.assert(Type.STRING, this.config.errorRoute)) {
throw new error.DataError(this.config, 'Router.construct: errorRoute must be string type');
}
},

@@ -48,3 +44,3 @@ /**

getErrorRoute: function Router_getErrorRoute() {
return this.config.errorRoute.split('/').splice(0, 2);
return this.config.errorRoute;
},

@@ -51,0 +47,0 @@ /**

@@ -5,3 +5,3 @@ {

"description": "Powerful lightweight mvc framework for nodejs",
"version": "0.1.0-beta-5",
"version": "0.1.0-beta-6",
"dependencies" : {

@@ -8,0 +8,0 @@ "mongoose": "3.8.x",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc