Permalink
Browse files

Removed the Error dir

  • Loading branch information...
1 parent 8486ff4 commit ec25f11c7eeb16cf9a56302383930302c510c80f @fk1blow committed Jun 1, 2011
Showing with 0 additions and 216 deletions.
  1. +0 −84 lib/Error/Error.js
  2. +0 −32 lib/Error/ErrorHandler.js
  3. +0 −100 lib/Error/errorTemplate.html.ejs
View
@@ -1,84 +0,0 @@
-function cl(o) {
- console.log(o);
-}
-
-
-/**
- * Error object
- *
- * - should make an object defining the section of the modules where the error has occured
- * - this class should be called from everywhere within the framework
- */
-Module('Seek', function() {
-
- Class('Errors', {
- my: {
- has: {
- errors: {
- init: null
- },
-
- section: {
- init: null
- },
-
- types: {
- init: ['not_defined', 'non_object_property_load', 'non_object_property_call']
- }
- },
-
- methods: {
- add: function(err_object) {
- this.errors = err_object;
- this.errors.headers = err_object.headers || 500;
- },
-
- retrieve: function() {
- return this.errors;
- },
-
- reset: function() {
- this.errors = null;
- },
-
- handleErrors: function() {
- Seek.HandleError.renderError(this.errors);
- this.reset();
- },
-
- hasErrors: function() {
- return (this.errors == null) ? false : true;
- }
- }
- }
- });
-
-
- Class('HandleError', {
- my: {
- has: {
- handle_error_output: {
- init: 'view'
- }
- },
-
- methods: {
- renderError: function(errors) {
- Seek.View.Base.renderExtraView('errorTemplate.html.ejs',
- __dirname + '/../Error/', {
- title: errors.error_object,
- error_stack_message: errors.error_object,
- error_stack: errors.error_object.stack.replace(errors.error_object, '').split(/\n/i),
- request_object: {
- url: Seek.URL.Request.getUrl(),
- params: Seek.ActionModule.ActionRouter.getParams()
- },
- controller: 'someController',
- action: 'someAction'
- }, null, 500);
- }
- }
- }
- });
-
-});
View
@@ -1,32 +0,0 @@
-Module('Seek', function() {
-
- Class('ErrorHandler', {
- my: {
- has: {
- handle_error_output: {
- init: 'view'
- },
-
- error_template_path: {
- init: __dirname + '/../Error/'
- },
-
- error_template_file: {
- init: 'errorTemplate.html.ejs'
- }
- },
-
- methods: {
- renderError: function() {
- Seek.View.Base.renderExtraView(this.error_template_file, {
- error_object: err,
- request: Seek.URL.Request.getRequest(),
- router_object: Seek.ActiveDispatcher.Router.getCurrentRoute(),
- params: Seek.ActionModule.ActionRouter.getParams()
- }, this.error_template);
- }
- }
- }
- });
-
-});
@@ -1,100 +0,0 @@
-<!DOCTYPE html>
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <title>Error:: {error_type, error_header}</title>
- <style>
- * {
- font-family:Arial, Verdana, sans-serif;
- font-size:1em;
- }
-
- body {
- padding:0 10px 10px;
- margin:0;
- background-color:#F2F2F2;
- color:#000;
- }
-
- h1, h4, p {
- padding:0;
- margin:0;
- }
-
-
- h1 {
- font-size:26px;
- font-weight:normal;
- line-height:60px;
- color:#000;
- }
-
-
- div.section {
- color:#fff;
- padding:10px;
- margin-bottom:20px;
- background-color:#9B9B9B;
- }
- div.section h4 {
- font-size:18px;
- color:#000;
- margin-bottom:10px;
- }
- div.section p {
- padding:10px;
- background-color:#000;
- color:#EAE8E8;
- font-size:13px;
- }
-
- ul {
- list-style-type:none;
- padding:10px;
- background-color:#000;
- color:#EAE8E8;
- font-size:13px;
- }
- ul li {
- line-height:18px;
- }
- </style>
-</head>
-<body>
- <h1>
- <%= @title %>
- </h1>
-
-
- <!-- Response status -->
- <div class="section">
- <h4>Response status</h4>
- <p style="color:#E52424; font-size:16px;"><b>500</b></p>
- </div>
- <!-- Response status -->
-
-
- <!-- Error trace -->
- <div class="section">
- <h4>Framework Stack Trace</h4>
- <ul style="margin-bottom:0;">
- <% for item in @error_stack: %>
- <li><%= item %></li>
- <% end %>
- </ul>
- </div>
- <!-- /Error trace -->
-
-
- <!-- Request object -->
- <div class="section">
- <h4>Request object</h4>
- <ul style="margin-bottom:0;">
- <li><b>url</b>: <%= @request_object.url %></li>
- <li><b>params</b>: <%= JSON.stringify(@request_object.params) %></li>
- <li><b>controller</b>: <%= @controller %></li>
- <li><b>action</b>: <%= @action %></li>
- </ul>
- </div>
- <!-- /Request object -->
-</body>
-</html>

0 comments on commit ec25f11

Please sign in to comment.