Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mapserver REST API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Miscellaneous
Mapserver REST API
Commits
e99e28bb
Commit
e99e28bb
authored
11 years ago
by
Wannes Rombouts
Browse files
Options
Downloads
Patches
Plain Diff
Re-added .message on exception for old python versions
parent
e773e57b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/webapp.py
+7
-0
7 additions, 0 deletions
src/webapp.py
with
7 additions
and
0 deletions
src/webapp.py
+
7
−
0
View file @
e99e28bb
...
...
@@ -53,6 +53,7 @@ def Created(location):
class
BadRequest
(
web
.
webapi
.
HTTPError
):
"""
`400 Bad Request` error.
"""
def
__init__
(
self
,
message
=
"
bad request
"
):
self
.
message
=
message
status
=
'
404 Bad Request
'
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -60,6 +61,7 @@ class BadRequest(web.webapi.HTTPError):
class
NotFound
(
web
.
webapi
.
HTTPError
):
"""
`404 Not Found` error.
"""
def
__init__
(
self
,
message
=
"
not found
"
):
self
.
message
=
message
status
=
'
404 Not Found
'
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -67,6 +69,7 @@ class NotFound(web.webapi.HTTPError):
class
Unauthorized
(
web
.
webapi
.
HTTPError
):
"""
`401 Unauthorized` error.
"""
def
__init__
(
self
,
message
=
"
unauthorized
"
):
self
.
message
=
message
status
=
"
401 Unauthorized
"
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -75,6 +78,7 @@ class Unauthorized(web.webapi.HTTPError):
class
Forbidden
(
web
.
webapi
.
HTTPError
):
"""
`403 Forbidden` error.
"""
def
__init__
(
self
,
message
=
"
forbidden
"
):
self
.
message
=
message
status
=
"
403 Forbidden
"
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -83,6 +87,7 @@ class Forbidden(web.webapi.HTTPError):
class
Conflict
(
web
.
webapi
.
HTTPError
):
"""
`409 Conflict` error.
"""
def
__init__
(
self
,
message
=
"
conflict
"
):
self
.
message
=
message
status
=
"
409 Conflict
"
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -91,6 +96,7 @@ class Conflict(web.webapi.HTTPError):
class
NotAcceptable
(
web
.
webapi
.
HTTPError
):
"""
`406 Not Acceptable` error.
"""
def
__init__
(
self
,
message
=
"
not acceptable
"
):
self
.
message
=
message
status
=
"
406 Not Acceptable
"
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
@@ -98,6 +104,7 @@ class NotAcceptable(web.webapi.HTTPError):
class
NotImplemented
(
web
.
webapi
.
HTTPError
):
"""
`501 Not Implemented` error.
"""
def
__init__
(
self
,
message
=
"
not implemented
"
):
self
.
message
=
message
status
=
"
501 Not Implemented
"
headers
=
{
'
Content-Type
'
:
'
text/html
'
}
web
.
webapi
.
HTTPError
.
__init__
(
self
,
status
,
headers
,
message
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment