You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
descriptions: Maven library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more.
Copy file name to clipboardExpand all lines: README.md
+71-20Lines changed: 71 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ Shippo external API.: Use this API to integrate with the Shippo service
36
36
*[Error Handling](#error-handling)
37
37
*[Server Selection](#server-selection)
38
38
*[Authentication](#authentication)
39
+
*[Debugging](#debugging)
39
40
40
41
<!-- End Table of Contents [toc] -->
41
42
@@ -275,24 +276,24 @@ We provide the API and web app for all your shipping needs.<!-- Start Error Hand
275
276
276
277
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
277
278
278
-
By default, an API error will throw a `models/errors/SDKError` exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `initiateOauth2Signin` method throws the following exceptions:
[`ShippoException`](./src/main/java/models/errors/ShippoException.java) is the base class for all HTTP error responses. It has the following properties:
InitiateOauth2SigninResponse res = sdk.carrierAccounts().initiateOauth2Signin()
309
310
.carrierAccountObjectId("<id>")
310
-
.redirectUri("https://enlightened-mortise.com/")
311
-
.state("Louisiana")
312
-
.shippoApiVersion("2018-02-08")
311
+
.redirectUri("https://ashamed-reporter.biz")
313
312
.call();
314
313
315
314
// handle response
316
315
}
317
316
}
318
317
```
318
+
319
+
### Error Classes
320
+
**Primary error:**
321
+
*[`ShippoException`](./src/main/java/models/errors/ShippoException.java): The base class for HTTP error responses.
322
+
323
+
<details><summary>Less common errors (9)</summary>
324
+
325
+
<br />
326
+
327
+
**Network errors:**
328
+
*`java.io.IOException` (always wrapped by `java.io.UncheckedIOException`). Commonly encountered subclasses of
329
+
`IOException` include `java.net.ConnectException`, `java.net.SocketTimeoutException`, `EOFException` (there are
330
+
many more subclasses in the JDK platform).
331
+
332
+
**Inherit from [`ShippoException`](./src/main/java/models/errors/ShippoException.java)**:
333
+
*[`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody.java): Invalid parameters provided by the user. Status code `400`. Applicable to 1 of 70 methods.*
334
+
*[`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody.java): Invalid ShippoToken or unsupported carrier account provided by the user. Status code `401`. Applicable to 1 of 70 methods.*
335
+
*[`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody.java): Invalid carrier account provided by the user. Status code `404`. Applicable to 1 of 70 methods.*
336
+
337
+
338
+
</details>
339
+
340
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
319
341
<!-- End Error Handling [errors] -->
320
342
321
343
<!-- Start Server Selection [server] -->
322
344
## Server Selection
323
345
324
346
### Override Server URL Per-Client
325
347
326
-
The default server can also be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example:
348
+
The default server can be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example:
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
450
+
451
+
__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
452
+
453
+
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
454
+
<!-- End Debugging [debug] -->
455
+
405
456
<!-- Placeholder for Future Speakeasy SDK Sections -->
0 commit comments