Skip to content

Commit c5b3e92

Browse files
committed
refactor(@angular-devkit/core): deprecate unused exception classes
With this change we deprecate exception classes that are not used in the CLI repo. DEPRECATED: - `ContentHasMutatedException`, `InvalidUpdateRecordException`, `UnimplementedException` and `MergeConflictException` symbol from `@angular-devkit/core` have been deprecated in favor of the symbol from `@angular-devkit/schematics`. - `UnsupportedPlatformException` - A custom error exception should be created instead.
1 parent a5e9976 commit c5b3e92

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

goldens/public-api/angular_devkit/core/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class CircularDependencyFoundException extends BaseException {
189189
// @public
190190
function classify(str: string): string;
191191

192-
// @public (undocumented)
192+
// @public @deprecated (undocumented)
193193
export class ContentHasMutatedException extends BaseException {
194194
constructor(path: string);
195195
}
@@ -532,7 +532,7 @@ export class InvalidPathException extends BaseException {
532532
constructor(path: string);
533533
}
534534

535-
// @public (undocumented)
535+
// @public @deprecated (undocumented)
536536
export class InvalidUpdateRecordException extends BaseException {
537537
constructor();
538538
}
@@ -1034,7 +1034,7 @@ class LoggingAnalytics implements Analytics {
10341034
// @public (undocumented)
10351035
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
10361036

1037-
// @public (undocumented)
1037+
// @public @deprecated (undocumented)
10381038
export class MergeConflictException extends BaseException {
10391039
constructor(path: string);
10401040
}
@@ -2013,7 +2013,7 @@ function trimNewlines(strings: TemplateStringsArray, ...values: any[]): string;
20132013
// @public
20142014
function underscore(str: string): string;
20152015

2016-
// @public (undocumented)
2016+
// @public @deprecated (undocumented)
20172017
export class UnimplementedException extends BaseException {
20182018
constructor();
20192019
}
@@ -2023,7 +2023,7 @@ export class UnknownException extends BaseException {
20232023
constructor(message: string);
20242024
}
20252025

2026-
// @public (undocumented)
2026+
// @public @deprecated (undocumented)
20272027
export class UnsupportedPlatformException extends BaseException {
20282028
constructor();
20292029
}

packages/angular_devkit/core/src/exception/exception.ts renamed to packages/angular_devkit/core/src/exception.ts

+19
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,47 @@ export class PathIsFileException extends BaseException {
3939
super(`Path "${path}" is a file.`);
4040
}
4141
}
42+
43+
/**
44+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
45+
*/
4246
export class ContentHasMutatedException extends BaseException {
4347
constructor(path: string) {
4448
super(`Content at path "${path}" has changed between the start and the end of an update.`);
4549
}
4650
}
51+
52+
/**
53+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
54+
*/
55+
4756
export class InvalidUpdateRecordException extends BaseException {
4857
constructor() {
4958
super(`Invalid record instance.`);
5059
}
5160
}
61+
62+
/**
63+
* @deprecated since version 14. Use the same symbol from `@angular-devkit/schematics`.
64+
*/
5265
export class MergeConflictException extends BaseException {
5366
constructor(path: string) {
5467
super(`A merge conflicted on path "${path}".`);
5568
}
5669
}
5770

71+
/**
72+
* @deprecated since version 14. Create a custom exception implementation instead.
73+
*/
5874
export class UnimplementedException extends BaseException {
5975
constructor() {
6076
super('This function is unimplemented.');
6177
}
6278
}
6379

80+
/**
81+
* @deprecated since version 14. Create a custom exception implementation instead.
82+
*/
6483
export class UnsupportedPlatformException extends BaseException {
6584
constructor() {
6685
super('This platform is not supported by this code path.');

packages/angular_devkit/core/src/exception/index.ts

-9
This file was deleted.

packages/angular_devkit/core/src/experimental/jobs/create-job-handler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { Observable, Observer, Subject, Subscription, from, isObservable, of } from 'rxjs';
1010
import { switchMap, tap } from 'rxjs/operators';
11-
import { BaseException } from '../../exception/index';
11+
import { BaseException } from '../../exception';
1212
import { JsonValue } from '../../json/index';
1313
import { LoggerApi } from '../../logger';
1414
import { isPromise } from '../../utils/index';
@@ -34,7 +34,7 @@ export class ChannelAlreadyExistException extends BaseException {
3434
export interface SimpleJobHandlerContext<
3535
A extends JsonValue,
3636
I extends JsonValue,
37-
O extends JsonValue
37+
O extends JsonValue,
3838
> extends JobHandlerContext<A, I, O> {
3939
createChannel: (name: string) => Observer<JsonValue>;
4040
input: Observable<I>;

packages/angular_devkit/core/src/experimental/jobs/exception.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { BaseException } from '../../exception/index';
9+
import { BaseException } from '../../exception';
1010
import { JobName } from './api';
1111

1212
export class JobNameAlreadyRegisteredException extends BaseException {

packages/angular_devkit/core/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as json from './json/index';
1212
import * as logging from './logger/index';
1313
import * as workspaces from './workspace';
1414

15-
export * from './exception/exception';
15+
export * from './exception';
1616
export * from './json/index';
1717
export * from './utils/index';
1818
export * from './virtual-fs/index';

packages/angular_devkit/core/src/json/schema/registry.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as https from 'https';
1313
import { Observable, from, isObservable } from 'rxjs';
1414
import { map } from 'rxjs/operators';
1515
import * as Url from 'url';
16-
import { BaseException } from '../../exception/exception';
16+
import { BaseException } from '../../exception';
1717
import { PartiallyOrderedSet, deepCopy } from '../../utils';
1818
import { JsonArray, JsonObject, JsonValue, isJsonObject } from '../utils';
1919
import {

0 commit comments

Comments
 (0)