annotate Lib/IMPL/Web/Exception.pm @ 252:34a3f8668b58

fixed IMPL::require IMPL::declare
author sergey
date Mon, 19 Nov 2012 01:28:58 +0400
parents 6d8092d8ce1b
children 4ddb27ff4a0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
1 package IMPL::Web::Exception;
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
2 use strict;
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
3 use warnings;
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
4
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
5 use IMPL::Const qw(:prop);
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
6 use IMPL::declare {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
7 base => [
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
8 'IMPL::Exception' => '@_'
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
9 ],
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
10 props => [
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
11 headers => PROP_ALL
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
12 ]
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
13 };
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
14
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
15 sub status {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
16 "500 Internal error";
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
17 }
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
18
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
19 1;
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
20
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
21 __END__
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
22
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
23 =pod
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
24
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
25 =head1 NAME
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
26
206
c8fe3f84feba +IMPL::Web::Handlers::ViewSelector
sergey
parents: 197
diff changeset
27 C<IMPL::Web::Exception> - Базовый класс для всех web-исключений, для ошибок вызванных
c8fe3f84feba +IMPL::Web::Handlers::ViewSelector
sergey
parents: 197
diff changeset
28 по вине клиента.
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
29
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
30 =head1 SYNOPSIS
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
31
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
32 Вызов исключения
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
33
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
34 =begin code
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
35
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
36 use IMPL::require {
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
37 WebException => 'IMPL::Web::WebException'
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
38 };
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
39
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
40 sub MyWebHandler {
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
41 # ...
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
42
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
43 die WebException->new("something is wrong");
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
44
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
45 # ...
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
46 }
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
47
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
48 =end code
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
49
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
50 =head1 MEMBERS
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
51
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
52 =head2 C<status()>
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
53
206
c8fe3f84feba +IMPL::Web::Handlers::ViewSelector
sergey
parents: 197
diff changeset
54 Возвращает C<HTTP> код ошибки. Каждый класс иключений должен переопределить данный метод.
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
55
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
56 =head2 C<[get,set]headers>
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
57
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
58 Ссылка на хеш с параметрами заголовка.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents: 206
diff changeset
59
197
6b1dda998839 Added IMPL::declare, IMPL::require, to simplify module definitions
sergey
parents:
diff changeset
60 =cut