auth-node: tweaked some error types
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
} from '../types';
|
||||
import { ProxyAuthenticator } from './types';
|
||||
import { prepareBackstageIdentityResponse } from '../identity';
|
||||
import { NotImplementedError } from '@backstage/errors';
|
||||
|
||||
/** @public */
|
||||
export interface ProxyAuthRouteHandlersOptions<TResult> {
|
||||
@@ -47,11 +48,11 @@ export function createProxyAuthRouteHandlers<TResult>(
|
||||
|
||||
return {
|
||||
async start(): Promise<void> {
|
||||
throw new Error('Not implemented');
|
||||
throw new NotImplementedError('Not implemented');
|
||||
},
|
||||
|
||||
async frameHandler(): Promise<void> {
|
||||
throw new Error('Not implemented');
|
||||
throw new NotImplementedError('Not implemented');
|
||||
},
|
||||
|
||||
async refresh(this: never, req: Request, res: Response): Promise<void> {
|
||||
|
||||
@@ -18,6 +18,7 @@ import { ZodSchema, ZodTypeDef } from 'zod';
|
||||
import { SignInResolver } from '../types';
|
||||
import zodToJsonSchema from 'zod-to-json-schema';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { InputError } from '@backstage/errors';
|
||||
|
||||
/** @public */
|
||||
export interface SignInResolverFactory<TAuthResult, TOptions> {
|
||||
@@ -55,7 +56,7 @@ export function createSignInResolverFactory<
|
||||
if (!optionsSchema) {
|
||||
return (resolverOptions?: TOptionsInput) => {
|
||||
if (resolverOptions) {
|
||||
throw new Error('sign-in resolver does not accept options');
|
||||
throw new InputError('sign-in resolver does not accept options');
|
||||
}
|
||||
return options.create(undefined as TOptionsOutput);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user