api06: fix syntax errors.
This commit is contained in:
parent
7151fa05e4
commit
2ff2cdf63d
1 changed files with 9 additions and 3 deletions
12
lib/osm.rb
12
lib/osm.rb
|
@ -10,7 +10,9 @@ module OSM
|
|||
|
||||
# The base class for API Errors.
|
||||
class APIError < RuntimeError
|
||||
def render_opts { :text => "", :status => :internal_server_error } end
|
||||
def render_opts
|
||||
{ :text => "", :status => :internal_server_error }
|
||||
end
|
||||
end
|
||||
|
||||
# Raised when an API object is not found.
|
||||
|
@ -19,12 +21,16 @@ module OSM
|
|||
|
||||
# Raised when a precondition to an API action fails sanity check.
|
||||
class APIPreconditionFailedError < APIError
|
||||
def render_opts { :text => "", :status => :precondition_failed } end
|
||||
def render_opts
|
||||
{ :text => "", :status => :precondition_failed }
|
||||
end
|
||||
end
|
||||
|
||||
# Raised when to delete an already-deleted object.
|
||||
class APIAlreadyDeletedError < APIError
|
||||
def render_opts { :text => "", :status => :gone } end
|
||||
def render_opts
|
||||
{ :text => "", :status => :gone }
|
||||
end
|
||||
end
|
||||
|
||||
# Raised when the provided version is not equal to the latest in the db.
|
||||
|
|
Loading…
Add table
Reference in a new issue