Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create Mayoi::Model::Constant::Error
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package Mayoi::Model::Constant::Error; | ||
|
||
use Exporter 'import'; | ||
use HTTP::Status qw/:constants/; | ||
|
||
our @EXPORT_OK = qw( | ||
BAD_REQUEST UNAUTHORIZED FORBIDDEN NOT_FOUND METHOD_NOT_ALLOWED | ||
INTERNAL_SERVER_ERROR SERVICE_UNAVAILABLE | ||
); | ||
our %EXPORT_TAGS = ( | ||
all => [@EXPORT_OK], | ||
); | ||
|
||
sub BAD_REQUEST () { HTTP_BAD_REQUEST } | ||
sub UNAUTHORIZED () { HTTP_UNAUTHORIZED } | ||
sub FORBIDDEN () { HTTP_FORBIDDEN } | ||
sub NOT_FOUND () { HTTP_NOT_FOUND } | ||
sub METHOD_NOT_ALLOWED () { HTTP_METHOD_NOT_ALLOWED } | ||
sub INTERNAL_SERVER_ERROR () { HTTP_INTERNAL_SERVER_ERROR } | ||
sub SERVICE_UNAVAILABLE () { HTTP_SERVICE_UNAVAILABLE } | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use Mayoi::Model::Constant::Error qw/:all/; | ||
use HTTP::Status qw/:constants/; | ||
|
||
is BAD_REQUEST, HTTP_BAD_REQUEST, 'BAD_REQUEST'; | ||
is UNAUTHORIZED, HTTP_UNAUTHORIZED, 'UNAUTHORIZED'; | ||
is FORBIDDEN, HTTP_FORBIDDEN, 'FORBIDDEN'; | ||
is NOT_FOUND, HTTP_NOT_FOUND, 'NOT_FOUND'; | ||
is METHOD_NOT_ALLOWED, HTTP_METHOD_NOT_ALLOWED, 'METHOD_NOT_ALLOWED'; | ||
is INTERNAL_SERVER_ERROR, HTTP_INTERNAL_SERVER_ERROR, 'INTERNAL_SERVER_ERROR'; | ||
is SERVICE_UNAVAILABLE, HTTP_SERVICE_UNAVAILABLE, 'SERVICE_UNAVAILABLE'; | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
use_ok 'Mayoi::Model::Constant::Error'; | ||
|
||
done_testing; |