ruby sdk exception handling section

This commit is contained in:
Damodar Lohani committed 2021-03-26 18:20:18 +05:45
1 parent d069e83b79
commit 0e20eaac77
1 file changed
+13
+13
View File
@@ -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)