Skip to content

Commit

Permalink
fixes error codes (#1)
Browse files Browse the repository at this point in the history
* raise for non 201 error

* raise for non 201 error

---------

Co-authored-by: Tony Dorfmeister <[email protected]>
  • Loading branch information
tweak-wtf and Tony Dorfmeister authored Jan 31, 2024
1 parent 793c085 commit da9710a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def apply_task(self, task, parent_id):
"folderId": parent_id,
}
resp = ayon_api.post(f"projects/{self.project['name']}/tasks", **payload)
if not resp.status_code == 200:
if not resp.status_code == 201:
raise Exception(f"Failed to create task: {resp.content}")

def create_hierarchy_item(self, item: dict, parent: str = None):
Expand All @@ -42,7 +42,7 @@ def create_hierarchy_item(self, item: dict, parent: str = None):

# create the item
resp = ayon_api.post(f"projects/{self.project['name']}/folders", **payload)
if resp.status_code != 200:
if resp.status_code != 201:
raise Exception(f"Failed to create item: {resp.content}")

if item["task_template"]["enabled"]:
Expand Down

0 comments on commit da9710a

Please sign in to comment.