Changed DebugLevel, default 500 page
This commit is contained in:
parent
24ddf7a4b8
commit
e570b4367b
@ -57,22 +57,22 @@ function Dragonfly( logHandler )
|
|||||||
this.Info( "Dragonfly ready.", Dragonfly.Visibility.VISIBLE );
|
this.Info( "Dragonfly ready.", Dragonfly.Visibility.VISIBLE );
|
||||||
}
|
}
|
||||||
|
|
||||||
Dragonfly.prototype.Info = function( mesg, visibility )
|
Dragonfly.prototype.Debug = function( mesg, visibility )
|
||||||
{
|
{
|
||||||
this.Log( mesg, Dragonfly.Spheres.THERMO, visibility );
|
this.Log( mesg, Dragonfly.Spheres.THERMO, visibility );
|
||||||
};
|
};
|
||||||
|
|
||||||
Dragonfly.prototype.Warning = function( mesg, visibility )
|
Dragonfly.prototype.Info = function( mesg, visibility )
|
||||||
{
|
{
|
||||||
this.Log( mesg, Dragonfly.Spheres.STRATO, visibility );
|
this.Log( mesg, Dragonfly.Spheres.STRATO, visibility );
|
||||||
};
|
};
|
||||||
|
|
||||||
Dragonfly.prototype.Error = function( mesg, visibility )
|
Dragonfly.prototype.Warning = function( mesg, visibility )
|
||||||
{
|
{
|
||||||
this.Log( mesg, Dragonfly.Spheres.HYDRO, visibility );
|
this.Log( mesg, Dragonfly.Spheres.HYDRO, visibility );
|
||||||
};
|
};
|
||||||
|
|
||||||
Dragonfly.prototype.Debug = function( mesg, visibility )
|
Dragonfly.prototype.Error = function( mesg, visibility )
|
||||||
{
|
{
|
||||||
this.Log( mesg, Dragonfly.Spheres.LITHO, visibility );
|
this.Log( mesg, Dragonfly.Spheres.LITHO, visibility );
|
||||||
};
|
};
|
||||||
|
@ -108,7 +108,7 @@ Router.prototype.setRoute = function( _route, _match )
|
|||||||
// Re-route function
|
// Re-route function
|
||||||
, reRoute: function( target, direct )
|
, reRoute: function( target, direct )
|
||||||
{
|
{
|
||||||
Dragonfly.Log(
|
Dragonfly.Debug(
|
||||||
"Reroute: " + target
|
"Reroute: " + target
|
||||||
+ ( direct ? ", Direct" : "" )
|
+ ( direct ? ", Direct" : "" )
|
||||||
);
|
);
|
||||||
|
@ -12,6 +12,7 @@ var Framework = function( garden )
|
|||||||
var Router = require( "./Router" );
|
var Router = require( "./Router" );
|
||||||
this.router = new Router( garden );
|
this.router = new Router( garden );
|
||||||
this.router.addRoute( "404", false, "404" );
|
this.router.addRoute( "404", false, "404" );
|
||||||
|
this.router.addRoute( "500", false, "500" );
|
||||||
this.router.addListener( "Route", this.parseResult.bind( this ) );
|
this.router.addListener( "Route", this.parseResult.bind( this ) );
|
||||||
|
|
||||||
this.handlers = {
|
this.handlers = {
|
||||||
@ -21,6 +22,12 @@ var Framework = function( garden )
|
|||||||
this.result = "404 Not Found";
|
this.result = "404 Not Found";
|
||||||
this.plantResult();
|
this.plantResult();
|
||||||
}.bind( this )
|
}.bind( this )
|
||||||
|
, "500": function()
|
||||||
|
{
|
||||||
|
this.HTTP.response.statusCode = 500;
|
||||||
|
this.result = "500 Internal Server Error";
|
||||||
|
this.plantResult();
|
||||||
|
}.bind( this )
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -65,7 +72,7 @@ Framework.prototype.parseResult = function()
|
|||||||
var method = this.router.route();
|
var method = this.router.route();
|
||||||
if( method )
|
if( method )
|
||||||
{
|
{
|
||||||
Dragonfly.Log( "Call " + method, Dragonfly.Spheres.THERMO );
|
Dragonfly.Debug( "Call " + method, Dragonfly.Spheres.THERMO );
|
||||||
|
|
||||||
if( this.handlers[ method ] )
|
if( this.handlers[ method ] )
|
||||||
{
|
{
|
||||||
@ -75,7 +82,7 @@ Framework.prototype.parseResult = function()
|
|||||||
}
|
}
|
||||||
else if( method === false )
|
else if( method === false )
|
||||||
{
|
{
|
||||||
Dragonfly.Log( "No route is defined to handle this URI", Dragonfly.Spheres.THERMO );
|
Dragonfly.Debug( "No route is defined to handle this URI", Dragonfly.Spheres.THERMO );
|
||||||
this.router.routeObj.reRoute( "404", true );
|
this.router.routeObj.reRoute( "404", true );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user