Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
prettier validation of path length
Browse files Browse the repository at this point in the history
  • Loading branch information
kmpm committed Dec 12, 2019
1 parent 0924555 commit f2193d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nodemcu_uploader/validate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .exceptions import PathLengthException
from .exceptions import ValidationException

MAX_FS_NAME_LEN = 31

Expand All @@ -8,6 +8,6 @@ def remotePath(path):
Raises exception if not valid
"""
if len(path) > MAX_FS_NAME_LEN:
raise PathLengthException
raise ValidationException('To long. >{0}'.format(MAX_FS_NAME_LEN), 'path', path)
if len(path) < 1:
raise PathLengthException
raise ValidationException('To short', 'path', path)

0 comments on commit f2193d8

Please sign in to comment.