Skip to content

Add Resource.create! method that raises on failure#6

Open
p8 wants to merge 1 commit into
digidentity:mainfrom
p8:create_bang
Open

Add Resource.create! method that raises on failure#6
p8 wants to merge 1 commit into
digidentity:mainfrom
p8:create_bang

Conversation

@p8

@p8 p8 commented Jul 30, 2024

Copy link
Copy Markdown
Contributor

Sometimes we want to raise an error if creating the resource is rejected on the server.
This should make it easier to detect when creating records fails, instead of silently failing.

Post.create!
# => raises RemoteResource::ResourceInvalid:
#      Validation failed: Title Please use a title which is more than 5 characters.

@p8 p8 force-pushed the create_bang branch 3 times, most recently from 9958694 to 56dd0ef Compare August 8, 2024 14:51
Sometimes we want to raise an error if creating the resource fails.

```ruby
   Post.create!
   # => raises RemoteResource::ResourceInvalid:
   #      Validation failed: Title Please use a title which is more than 5 characters.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant