Skip to content

Commit

Permalink
refactor(core): link errors to ADEV
Browse files Browse the repository at this point in the history
Console error links will now point to adev.
  • Loading branch information
JeanMeche committed Apr 26, 2024
1 parent bf8814c commit 52aaac6
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/common/test/directives/ng_for_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('ngFor', () => {

getComponent().items = <any>'whaaa';
expect(() => fixture.detectChanges()).toThrowError(
`NG02200: Cannot find a differ supporting object 'whaaa' of type 'string'. NgFor only supports binding to Iterables, such as Arrays. Find more at https://angular.io/errors/NG02200`,
`NG02200: Cannot find a differ supporting object 'whaaa' of type 'string'. NgFor only supports binding to Iterables, such as Arrays. Find more at https://angular.dev/errors/NG02200`,
);
}));

Expand All @@ -127,7 +127,7 @@ describe('ngFor', () => {

getComponent().items = <any>{'stuff': 'whaaa'};
expect(() => fixture.detectChanges()).toThrowError(
`NG02200: Cannot find a differ supporting object '\[object Object\]' of type 'object'. NgFor only supports binding to Iterables, such as Arrays. Did you mean to use the keyvalue pipe? Find more at https://angular.io/errors/NG02200`,
`NG02200: Cannot find a differ supporting object '\[object Object\]' of type 'object'. NgFor only supports binding to Iterables, such as Arrays. Did you mean to use the keyvalue pipe? Find more at https://angular.dev/errors/NG02200`,
);
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('NgModule', () => {
.toThrowError(
'NG0200: Circular dependency in DI detected for AModule. ' +
'Dependency path: AModule > BModule > AModule. ' +
'Find more at https://angular.io/errors/NG0200');
'Find more at https://angular.dev/errors/NG0200');
});

it('merges imports and exports', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-cli/src/ngtsc/diagnostics/src/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {ErrorCode} from './error_code';

/**
* Contains a set of error messages that have detailed guides at angular.io.
* Full list of available error guides can be found at https://angular.io/errors
* Full list of available error guides can be found at https://angular.dev/errors
*/
export const COMPILER_ERRORS_WITH_GUIDES = new Set([
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';
2 changes: 1 addition & 1 deletion packages/core/src/error_details_base_url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
* - packages/core/src/error_details_base_url.ts
*/
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
export const ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.dev/errors';

/**
* URL for the XSS security documentation.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {ERROR_DETAILS_PAGE_BASE_URL} from './error_details_base_url';
* angular.io. This extra annotation is needed to avoid introducing a separate set to store
* error codes which have guides, which might leak into runtime code.
*
* Full list of available error guides can be found at https://angular.io/errors.
* Full list of available error guides can be found at https://angular.dev/errors.
*
* Error code ranges per package:
* - core (this package): 100-999
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/image_performance_warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function logLazyLCPWarning(src: string) {
`changing the loading value of the LCP image to "eager", or by using the ` +
`NgOptimizedImage directive's prioritization utilities. For more ` +
`information about addressing or disabling this warning, see ` +
`https://angular.io/errors/NG0913`));
`https://angular.dev/errors/NG0913`));
}

function logOversizedImageWarning(src: string) {
Expand All @@ -178,5 +178,5 @@ function logOversizedImageWarning(src: string) {
`An image with src ${src} has intrinsic file dimensions much larger than its ` +
`rendered size. This can negatively impact application loading performance. ` +
`For more information about addressing or disabling this warning, see ` +
`https://angular.io/errors/NG0913`));
`https://angular.dev/errors/NG0913`));
}
2 changes: 1 addition & 1 deletion packages/core/test/acceptance/di_forward_ref_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('di with forwardRef', () => {
TestBed.configureTestingModule({declarations: [DirectiveA, DirectiveB, MyComp]});
expect(() => TestBed.createComponent(MyComp))
.toThrowError(
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.io/errors/NG0200');
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.dev/errors/NG0200');
});

describe('flags', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/acceptance/di_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveA, DirectiveB, MyComp]});
expect(() => TestBed.createComponent(MyComp))
.toThrowError(
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.io/errors/NG0200');
'NG0200: Circular dependency in DI detected for DirectiveA. Find more at https://angular.dev/errors/NG0200');
});

describe('flags', () => {
Expand Down Expand Up @@ -2160,7 +2160,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveString, MyComp, MyApp]});
expect(() => TestBed.createComponent(MyApp))
.toThrowError(
'NG0201: No provider for String found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for String found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

it('should not find other directives on the host itself', () => {
Expand Down Expand Up @@ -2236,7 +2236,7 @@ describe('di', () => {
TestBed.configureTestingModule({declarations: [DirectiveComp, MyComp, MyApp]});
expect(() => TestBed.createComponent(MyApp))
.toThrowError(
'NG0201: No provider for MyApp found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for MyApp found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

describe('regression', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/application_init_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('ApplicationInitStatus', () => {
'NG0209: Unexpected type of the `APP_INITIALIZER` token value ' +
`(expected an array, but got string). ` +
'Please check that the `APP_INITIALIZER` token is configured as a ' +
'`multi: true` provider. Find more at https://angular.io/errors/NG0209',
'`multi: true` provider. Find more at https://angular.dev/errors/NG0209',
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/application_ref_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ describe('bootstrap', () => {
const expectedErrMsg = `NG0403: The module MyModule was bootstrapped, ` +
`but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
`Please define one of these. ` +
`Find more at https://angular.io/errors/NG0403`;
`Find more at https://angular.dev/errors/NG0403`;
expect(e.message).toEqual(expectedErrMsg);
expect(mockConsole.res[0].join('#')).toEqual('ERROR#Error: ' + expectedErrMsg);
});
Expand Down
10 changes: 5 additions & 5 deletions packages/core/test/linker/view_injector_integration_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ describe('View injector', () => {
TestBed.configureTestingModule({declarations: [CycleDirective]});
expect(() => createComponent('<div cycleDirective></div>'))
.toThrowError(
'NG0200: Circular dependency in DI detected for CycleDirective. Find more at https://angular.io/errors/NG0200');
'NG0200: Circular dependency in DI detected for CycleDirective. Find more at https://angular.dev/errors/NG0200');
});

it('should not instantiate a directive in a view that has a host dependency on providers' +
Expand All @@ -633,7 +633,7 @@ describe('View injector', () => {

expect(() => createComponent('<div simpleComponent></div>'))
.toThrowError(
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

it('should not instantiate a directive in a view that has a host dependency on providers' +
Expand All @@ -648,7 +648,7 @@ describe('View injector', () => {

expect(() => createComponent('<div simpleComponent someOtherDirective></div>'))
.toThrowError(
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for service found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

it('should not instantiate a directive in a view that has a self dependency on a parent directive',
Expand All @@ -657,7 +657,7 @@ describe('View injector', () => {
expect(
() => createComponent('<div simpleDirective><div needsDirectiveFromSelf></div></div>'))
.toThrowError(
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

it('should instantiate directives that depend on other directives', fakeAsync(() => {
Expand Down Expand Up @@ -699,7 +699,7 @@ describe('View injector', () => {
SimpleComponent, {set: {template: '<div needsDirectiveFromHost></div>'}});
expect(() => createComponent('<div simpleComponent simpleDirective></div>'))
.toThrowError(
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for SimpleDirective found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});

it('should allow to use the NgModule injector from a root ViewContainerRef.parentInjector',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/render3/di_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('di', () => {
TestBed.createComponent(App).detectChanges();
})
.toThrowError(
'NG0201: No provider for DirNotOnSelf found in NodeInjector. Find more at https://angular.io/errors/NG0201');
'NG0201: No provider for DirNotOnSelf found in NodeInjector. Find more at https://angular.dev/errors/NG0201');
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/runtime_error_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {RuntimeError, RuntimeErrorCode} from '../src/errors';
describe('RuntimeError utils', () => {
it('should correctly format an error without an error message', () => {
const error = new RuntimeError<RuntimeErrorCode>(RuntimeErrorCode.EXPORT_NOT_FOUND, '');
expect(error.toString()).toBe('Error: NG0301. Find more at https://angular.io/errors/NG0301');
expect(error.toString()).toBe('Error: NG0301. Find more at https://angular.dev/errors/NG0301');
});

it('should correctly format an error without an error message not aio guide', () => {
Expand All @@ -27,7 +27,7 @@ describe('RuntimeError utils', () => {
it('should correctly format an error with both an error message and an aio guide', () => {
const error = new RuntimeError(RuntimeErrorCode.EXPORT_NOT_FOUND, 'Some error message');
expect(error.toString())
.toBe('Error: NG0301: Some error message. Find more at https://angular.io/errors/NG0301');
.toBe('Error: NG0301: Some error message. Find more at https://angular.dev/errors/NG0301');
});

['.', ',', ';', '!', '?'].forEach(
Expand All @@ -40,6 +40,6 @@ describe('RuntimeError utils', () => {
new RuntimeError<RuntimeErrorCode>(RuntimeErrorCode.PIPE_NOT_FOUND, errorMessage);
expect(error.toString())
.toBe(`Error: NG0302: Pipe not found${
character} Find more at https://angular.io/errors/NG0302`);
character} Find more at https://angular.dev/errors/NG0302`);
}));
});
8 changes: 4 additions & 4 deletions packages/forms/test/directives_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('Form Directives', () => {

expect(() => form.addControl(dir)).toThrowError(
new RegExp(
`NG01203: No value accessor for form control name: 'login'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'login'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
Expand All @@ -225,7 +225,7 @@ describe('Form Directives', () => {

expect(() => form.addControl(dir)).toThrowError(
new RegExp(
`NG01203: No value accessor for form control path: 'passwords -> password'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control path: 'passwords -> password'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
Expand Down Expand Up @@ -620,7 +620,7 @@ describe('Form Directives', () => {

expect(() => namedDir.ngOnChanges({})).toThrowError(
new RegExp(
`NG01203: No value accessor for form control name: 'one'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'one'. Find more at https://angular.dev/errors/NG01203`,
),
);
});
Expand All @@ -630,7 +630,7 @@ describe('Form Directives', () => {

expect(() => unnamedDir.ngOnChanges({})).toThrowError(
new RegExp(
`NG01203: No value accessor for form control unspecified name attribute. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control unspecified name attribute. Find more at https://angular.dev/errors/NG01203`,
),
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/test/form_control_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ import {asyncValidator, asyncValidatorReturningObservable} from './util';
expect(fn).toThrowError(
'NG01101: Expected async validator to return Promise or Observable. ' +
'Are you using a synchronous validator where an async validator is expected? ' +
'Find more at https://angular.io/errors/NG01101',
'Find more at https://angular.dev/errors/NG01101',
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/forms/test/reactive_integration_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5763,7 +5763,7 @@ describe('reactive forms integration tests', () => {
expect(() => {
fixture.detectChanges();
}).toThrowError(
`NG01203: No value accessor for form control name: 'control'. Find more at https://angular.io/errors/NG01203`,
`NG01203: No value accessor for form control name: 'control'. Find more at https://angular.dev/errors/NG01203`,
);

// Making sure that cleanup between tests doesn't cause any issues
Expand Down

0 comments on commit 52aaac6

Please sign in to comment.