server/posts: improve errors for bad note points
This commit is contained in:
parent
721900ee2f
commit
9e2dace73f
1 changed files with 4 additions and 1 deletions
|
@ -292,7 +292,10 @@ def update_post_notes(post, notes):
|
|||
pos_y = float(point[1])
|
||||
if not 0 <= pos_x <= 1 or not 0 <= pos_y <= 1:
|
||||
raise InvalidPostNoteError(
|
||||
'A point in note\'s polygon must be in 0..1 range.')
|
||||
'All points must fit in the image (0..1 range).')
|
||||
except KeyError:
|
||||
raise InvalidPostNoteError(
|
||||
'Expected array of length 2.')
|
||||
except ValueError:
|
||||
raise InvalidPostNoteError(
|
||||
'A point in note\'s polygon must be numeric.')
|
||||
|
|
Loading…
Reference in a new issue