Skip to content

Commit

Permalink
fix(forms): Runtime error pages must begin with leading zero (#47991)
Browse files Browse the repository at this point in the history
I recently checked in a new error guide. The corresponding page must have a leading zero because it is a runtime error. Otherwise links to this error guide will be invalid.

PR Close #47991
  • Loading branch information
dylhunn authored and AndrewKushnir committed Nov 8, 2022
1 parent 02918c9 commit ae29f98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
@@ -1,5 +1,5 @@
@name Missing value accessor
@category forms
@category runtime
@shortDescription You must register an `NgValueAccessor` with a custom form control

@description
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/errors.ts
Expand Up @@ -113,6 +113,7 @@ export function formatRuntimeError<T extends number = RuntimeErrorCode>(
code: T, message: null|false|string): string {
// Error code might be a negative number, which is a special marker that instructs the logic to
// generate a link to the error details page on angular.io.
// We also prepend `0` to non-compile-time errors.
const fullCode = `NG0${Math.abs(code)}`;

let errorMessage = `${fullCode}${message ? ': ' + message.trim() : ''}`;
Expand Down

0 comments on commit ae29f98

Please sign in to comment.