Introduce the @backstage/errors package.

Encode thrown errors in the backend as a JSON payload using a facility in that package, and render helpful frontend displays of those errors.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-03-08 17:02:51 +01:00
parent 9804a5273e
commit 8686eb38cf
85 changed files with 880 additions and 177 deletions
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ConflictError, NotFoundError } from '@backstage/backend-common';
import { ConflictError, NotFoundError } from '@backstage/errors';
import { CatalogApi } from '@backstage/catalog-client';
import { UserEntity } from '@backstage/catalog-model';
@@ -22,7 +22,7 @@ import {
BackstageIdentity,
AuthProviderConfig,
} from '../../providers/types';
import { InputError } from '@backstage/backend-common';
import { InputError } from '@backstage/errors';
import { TokenIssuer } from '../../identity';
import { verifyNonce } from './helpers';
import { postMessageResponse, ensuresXRequestedWith } from '../flow';
@@ -16,7 +16,7 @@
import express from 'express';
import { Config } from '@backstage/config';
import { InputError } from '@backstage/backend-common';
import { InputError } from '@backstage/errors';
import { readState } from './helpers';
import { AuthProviderRouteHandlers } from '../../providers/types';
+1 -1
View File
@@ -23,10 +23,10 @@ import {
AuthProviderFactory,
} from '../providers';
import {
NotFoundError,
PluginDatabaseManager,
PluginEndpointDiscovery,
} from '@backstage/backend-common';
import { NotFoundError } from '@backstage/errors';
import { CatalogClient } from '@backstage/catalog-client';
import { Config } from '@backstage/config';
import { createOidcRouter, DatabaseKeyStore, TokenFactory } from '../identity';