@@ -33,6 +33,8 @@ export class Offerings {
33
33
/**
34
34
* @param {Offerings.RequestOptions } requestOptions - Request-specific configuration.
35
35
*
36
+ * @throws {@link ReferralExchange.UnauthorizedError }
37
+ *
36
38
* @example
37
39
* await client.offerings.list()
38
40
*/
@@ -47,8 +49,8 @@ export class Offerings {
47
49
headers : {
48
50
"X-Fern-Language" : "JavaScript" ,
49
51
"X-Fern-SDK-Name" : "@opengovsg/refx-ts-sdk" ,
50
- "X-Fern-SDK-Version" : "0.0.28 " ,
51
- "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.28 " ,
52
+ "X-Fern-SDK-Version" : "0.0.29 " ,
53
+ "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.29 " ,
52
54
"X-Fern-Runtime" : core . RUNTIME . type ,
53
55
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
54
56
...( await this . _getCustomAuthorizationHeaders ( ) ) ,
@@ -65,10 +67,15 @@ export class Offerings {
65
67
}
66
68
67
69
if ( _response . error . reason === "status-code" ) {
68
- throw new errors . ReferralExchangeError ( {
69
- statusCode : _response . error . statusCode ,
70
- body : _response . error . body ,
71
- } ) ;
70
+ switch ( _response . error . statusCode ) {
71
+ case 401 :
72
+ throw new ReferralExchange . UnauthorizedError ( _response . error . body as unknown ) ;
73
+ default :
74
+ throw new errors . ReferralExchangeError ( {
75
+ statusCode : _response . error . statusCode ,
76
+ body : _response . error . body ,
77
+ } ) ;
78
+ }
72
79
}
73
80
74
81
switch ( _response . error . reason ) {
@@ -91,6 +98,8 @@ export class Offerings {
91
98
* @param {ReferralExchange.OfferingsListTimeslotsRequest } request
92
99
* @param {Offerings.RequestOptions } requestOptions - Request-specific configuration.
93
100
*
101
+ * @throws {@link ReferralExchange.UnauthorizedError }
102
+ *
94
103
* @example
95
104
* await client.offerings.listTimeslots("offeringId", {
96
105
* from: 1.1,
@@ -116,8 +125,8 @@ export class Offerings {
116
125
headers : {
117
126
"X-Fern-Language" : "JavaScript" ,
118
127
"X-Fern-SDK-Name" : "@opengovsg/refx-ts-sdk" ,
119
- "X-Fern-SDK-Version" : "0.0.28 " ,
120
- "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.28 " ,
128
+ "X-Fern-SDK-Version" : "0.0.29 " ,
129
+ "User-Agent" : "@opengovsg/refx-ts-sdk/0.0.29 " ,
121
130
"X-Fern-Runtime" : core . RUNTIME . type ,
122
131
"X-Fern-Runtime-Version" : core . RUNTIME . version ,
123
132
...( await this . _getCustomAuthorizationHeaders ( ) ) ,
@@ -135,10 +144,15 @@ export class Offerings {
135
144
}
136
145
137
146
if ( _response . error . reason === "status-code" ) {
138
- throw new errors . ReferralExchangeError ( {
139
- statusCode : _response . error . statusCode ,
140
- body : _response . error . body ,
141
- } ) ;
147
+ switch ( _response . error . statusCode ) {
148
+ case 401 :
149
+ throw new ReferralExchange . UnauthorizedError ( _response . error . body as unknown ) ;
150
+ default :
151
+ throw new errors . ReferralExchangeError ( {
152
+ statusCode : _response . error . statusCode ,
153
+ body : _response . error . body ,
154
+ } ) ;
155
+ }
142
156
}
143
157
144
158
switch ( _response . error . reason ) {
0 commit comments