File tree Expand file tree Collapse file tree 2 files changed +37
-12
lines changed
Expand file tree Collapse file tree 2 files changed +37
-12
lines changed Original file line number Diff line number Diff line change @@ -873,7 +873,8 @@ const data = {
873873
874874try {
875875 const csrOrderResponse = await CsrOrder .createAsync (data);
876- console .log (csrOrderResponse);
876+ console .log (csrOrderResponse .orderId );
877+ // 31e0b16b-4720-4f2e-bb99-1399eeb2ff9e
877878}
878879catch (e) {
879880 console .log (e);
@@ -882,15 +883,39 @@ catch (e) {
882883
883884### Fetch Existing CSR Order
884885
886+ If the CSR order is in an FAILED state, the SDK will throw an error
887+
888+ #### COMPLETE or PROCESSING resposne
889+
885890``` js
886891const csrOrderId = " 1234-abc"
887892
888893try {
889894 const csrOrderData = await CsrOrder .getAsync (csrOrderId);
890- console .log (csrOrderData);
895+ console .log (csrOrderData .status );
896+ // COMPLETE
891897}
892898catch (e) {
893899 console .log (e);
894900}
895901```
896902
903+ #### FAILED response
904+
905+ ``` js
906+ const csrOrderId = " 1234-abc"
907+
908+ try {
909+ const csrOrderData = await CsrOrder .getAsync (csrOrderId);
910+ console .log (csrOrderData .status );
911+ // Won't fire, as request is failed
912+ }
913+ catch (e) {
914+ console .log (e);
915+ // [BandwidthError: CSR is not available for this TN] {
916+ // code: 26500,
917+ // message: 'CSR is not available for this TN',
918+ // httpStatus: 200
919+ // }
920+ }
921+ ```
You can’t perform that action at this time.
0 commit comments