lib/Eidolon/Error.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 20 CC 1 SCAR 6.9
CC
1
Cov
0%
error
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Eidolon::Error;
2 # ==============================================================================
3 #
4 # Eidolon
5 # Copyright (c) 2009, Atma 7
6 # ---
7 # Eidolon/Error.pm - system-wide error handler
8 #
9 # ==============================================================================
10  
11 use warnings;
12 use strict;
13  
14 our $VERSION = "0.02"; # 2009-05-12 06:23:39
15  
16 # ------------------------------------------------------------------------------
17 # error($exception)
18 # error handler
19 # ------------------------------------------------------------------------------
20 sub error
21 {
22 my ($r, $exception, $file, $line, $query, $type);
23
24 $exception = shift;
25 $file = $exception->file;
26 $line = $exception->line;
27  
28 $r = Eidolon::Core::Registry->get_instance;
29 $type = ref $exception;
30  
31 $r->cgi->send_header;
32  
33 print << "EOT";
34 <html>
35 <head>
36 <title>Eidolon</title>
37 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
38 </head>
39 <body>
40 <style type="text/css">
41 body {
42 margin: 0px;
43 padding: 0px;
44 text-align: center;
45 background-color: #FFF;
46 }
47  
48 div#window {
49 width: 800px;
50 height: 100%;
51 background-color: #F0F0F0;
52 }
53  
54 div#content {
55 width: 100%;
56 font-size: 9pt;
57 font-family: Verdana, Tahoma;
58 text-align: left;
59 color: #606060;
60 padding: 15px 15px 15px 15px;
61 -moz-box-sizing: border-box;
62 }
63  
64 h1 {
65 font-size: 16pt;
66 margin-top: 0;
67 text-transform: lowercase;
68 font-weight: normal;
69 border-bottom: 1px dashed #606060;
70 padding-bottom: 5px;
71 }
72 </style>
73 <center>
74 <div id="window">
75 <div id="content">
76 <h1>software error</h1>
77 <p>$exception</p>
78  
79 <ul>
80 <li>Exception: <em>$type</em></li>
81 <li>File: <em>$file</em></li>
82 <li>Line: <em>$line</em></li>
83 </ul>
84  
85 <br /><br />
86 </div>
87 </div>
88 </center>
89 </body>
90 </html>
91 EOT
92 }
93  
94 1;
95  
96 __END__