MCPcopy Create free account
hub / github.com/angular/dev-infra / getErrorMessage

Function getErrorMessage

ng-dev/release/versioning/npm-command.ts:179–195  ·  view source on GitHub ↗

Robustly extracts an error message string from an unknown error object.

(error: unknown)

Source from the content-addressed store, hash-verified

177 await ChildProcess.spawnInteractive('npm', args);
178 }
179
180 /**
181 * Log out of NPM at a provided registry.
182 * @returns Whether the user was logged out of NPM.
183 */
184 static async logout(registryUrl: string | undefined): Promise<boolean> {
185 const args = ['logout'];
186 // If a custom registry URL has been specified, add the `--registry` flag. The `--registry` flag
187 // must be spliced into the correct place in the command as npm expects it to be the flag
188 // immediately following the logout subcommand.
189 if (registryUrl !== undefined) {
190 args.splice(1, 0, '--registry', registryUrl);
191 }
192 try {
193 await ChildProcess.spawn('npm', args, {mode: 'silent'});
194 } finally {
195 return this.checkIsLoggedIn(registryUrl);
196 }
197 }
198}

Callers 1

checkVersionExistsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected