Address review feedback: add cast rationale, drop redundant assertError

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
Fredrik Adelöw
2026-03-28 17:07:00 +01:00
parent cba19b13de
commit c38610bd9d
2 changed files with 3 additions and 2 deletions
@@ -24,6 +24,8 @@ export class ClarifyFailuresFetchMiddleware implements FetchMiddleware {
apply(next: typeof fetch): typeof fetch {
return async (input, init) => {
try {
// NOTE: The "as any" cast is because of subtle undici type differences
// that happened in a node types bump. Immaterial at runtime.
return await next(input as any, init);
} catch (e) {
if (e instanceof TypeError && e.message === 'Failed to fetch') {
@@ -24,7 +24,7 @@ import type {
EvaluatePermissionRequest,
EvaluatePermissionResponse,
} from '@backstage/plugin-permission-common';
import { assertError, ForwardedError } from '@backstage/errors';
import { ForwardedError } from '@backstage/errors';
export type ExtensionPredicateContext = {
featureFlags: string[];
@@ -98,7 +98,6 @@ export function createPredicateContextLoader(options: {
(_, i) => responses[i].result === 'ALLOW',
);
} catch (error) {
assertError(error);
throw new ForwardedError(
'Failed to authorize extension permissions',
error,