How to use the grpc-web.StatusCode.FAILED_PRECONDITION function in grpc-web

To help you get started, we’ve selected a few grpc-web 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 pipe-cd / pipe / pkg / app / web / src / mocks / services / environment.ts View on Github external
export const addEnvironmentHandler = createHandler(
  "/AddEnvironment",
  () => {
    return new AddEnvironmentResponse();
  }
);

export const deleteEnvironmentHandler = createHandler<
  DeleteEnvironmentResponse
>("/DeleteEnvironment", () => {
  return new DeleteEnvironmentResponse();
});

export const deleteEnvironmentFailedHandler = createHandlerWithError(
  "/DeleteEnvironment",
  StatusCode.FAILED_PRECONDITION
);

export const environmentHandlers = [
  listEnvironmentHandler,
  deleteEnvironmentHandler,
  addEnvironmentHandler,
];