(apiClient: CliApiClient)
| 322 | } |
| 323 | |
| 324 | async function createAuthorizationCode(apiClient: CliApiClient) { |
| 325 | return await tracer.startActiveSpan("createAuthorizationCode", async (span) => { |
| 326 | try { |
| 327 | //generate authorization code |
| 328 | const createAuthCodeSpinner = spinner(); |
| 329 | createAuthCodeSpinner.start("Creating authorization code"); |
| 330 | const authorizationCodeResult = await apiClient.createAuthorizationCode(); |
| 331 | |
| 332 | if (!authorizationCodeResult.success) { |
| 333 | createAuthCodeSpinner.stop( |
| 334 | `Failed to create authorization code\n${authorizationCodeResult.error}` |
| 335 | ); |
| 336 | |
| 337 | throw new SkipLoggingError( |
| 338 | `Failed to create authorization code\n${authorizationCodeResult.error}` |
| 339 | ); |
| 340 | } |
| 341 | |
| 342 | createAuthCodeSpinner.stop("Created authorization code"); |
| 343 | |
| 344 | span.end(); |
| 345 | |
| 346 | return authorizationCodeResult.data; |
| 347 | } catch (e) { |
| 348 | recordSpanException(span, e); |
| 349 | |
| 350 | span.end(); |
| 351 | |
| 352 | throw e; |
| 353 | } |
| 354 | }); |
| 355 | } |
no test coverage detected
searching dependent graphs…