How to use the @azure/core-tracing.CanonicalCode.UNAUTHENTICATED function in @azure/core-tracing

To help you get started, we’ve selected a few @azure/core-tracing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / identity / identity / src / credentials / authorizationCodeCredential.ts View on Github external
Accept: "application/json",
            "Content-Type": "application/x-www-form-urlencoded"
          },
          abortSignal: options && options.abortSignal,
          spanOptions: newOptions.spanOptions
        });

        tokenResponse = await this.identityClient.sendTokenRequest(webResource);
      }

      this.lastTokenResponse = tokenResponse;
      return (tokenResponse && tokenResponse.accessToken) || null;
    } catch (err) {
      const code =
        err.name === AuthenticationErrorName
          ? CanonicalCode.UNAUTHENTICATED
          : CanonicalCode.UNKNOWN;
      span.setStatus({
        code,
        message: err.message
      });
      throw err;
    } finally {
      span.end();
    }
  }
}

@azure/core-tracing

Provides low-level interfaces and helper methods for tracing in Azure SDK

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis