mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
ruby sdk exception handling section
This commit is contained in:
1 parent
d069e83b79
commit
0e20eaac77
1 file changed
+13
@@ -41,6 +41,19 @@ users = Appwrite::Users.new(client);
|
||||
result = users.create(email: 'email@example.com', password: 'password');
|
||||
```
|
||||
|
||||
### Error Handling
|
||||
The Appwrite Ruby SDK raises `Appwrite::Exception` object with `message`, `code` and `response` properties. You can handle any errors by catching `Appwrite::Exception` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
|
||||
|
||||
```ruby
|
||||
users = Appwrite::Users.new(client);
|
||||
|
||||
begin
|
||||
result = users.create(email: 'email@example.com', password: 'password');
|
||||
rescue Appwrite::Exception => error
|
||||
puts error.message
|
||||
end
|
||||
```
|
||||
|
||||
### Learn more
|
||||
You can use followng resources to learn more and get help
|
||||
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
|
||||
|
||||
Reference in new issue
Block a user