Skip to content

Commit

Permalink
Merge pull request #135 from cloudwan/support_custom_exception_from_g…
Browse files Browse the repository at this point in the history
…ohan_script

Improve error code in the demo pet store
  • Loading branch information
nati committed Apr 1, 2016
2 parents 80c44e1 + dac15df commit 6db4e13
Show file tree
Hide file tree
Showing 3 changed files with 512 additions and 506 deletions.
20 changes: 13 additions & 7 deletions etc/example_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,19 @@ extensions:
id: $resource.pet_id
register: pet
- when: pet.status != "available"
fail: "Pet isn't available"
- db_update:
tx: $transaction
schema_id: pet
data:
id: $resource.pet_id
status: "pending"
blocks:
- vars:
exception:
name: CustomException
code: 400
message: "Selected pet isn't available"
else:
- db_update:
tx: $transaction
schema_id: pet
data:
id: $resource.pet_id
status: "pending"
- when: event_type == "post_update_in_transaction"
blocks:
- when: resource.status == "approved"
Expand Down
Loading

0 comments on commit 6db4e13

Please sign in to comment.