Skip to content

Commit 15a9773

Browse files
committed
clarify use case of error plugin
1 parent 203a6b5 commit 15a9773

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/error.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ and the response coming from them::
3030
// Something has not been found
3131
}
3232
}
33+
34+
The error plugin is intended for when an application operates with the client directly. When
35+
writing a library around an API, the best practice is to have the client convert responses into
36+
domain objects, and transform HTTP errors into meaningful domain exceptions. In that scenario,
37+
the ErrorPlugin is not needed. It is more efficient to check the HTTP status codes yourself than
38+
throwing and catching exceptions.

0 commit comments

Comments
 (0)