Skip to content

Commit

Permalink
better error notifications for malformed projects
Browse files Browse the repository at this point in the history
  • Loading branch information
SelfhostedPro committed May 28, 2021
1 parent 8a20b40 commit 9b3f00c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/api/actions/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ def get_compose(name):
volumes = []
services = {}
compose = open(file)
loaded_compose = yaml.load(compose, Loader=yaml.SafeLoader)
try:
loaded_compose = yaml.load(compose, Loader=yaml.SafeLoader)
except yaml.scanner.ScannerError as exc:
raise HTTPException(422, f"{exc.problem_mark.line}:{exc.problem_mark.column} - {exc.problem}")
if loaded_compose.get("volumes"):
for volume in loaded_compose.get("volumes"):
volumes.append(volume)
Expand Down

0 comments on commit 9b3f00c

Please sign in to comment.