зеркало из https://github.com/Azure/autorest.git
Add log for actual error when resolving package version (#4016)
* Add log for actual error when resolving package version * .
This commit is contained in:
Родитель
e2213f4671
Коммит
e783f89846
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@azure-tools/extension",
|
||||
"comment": "**Add** Logging when fail to fetch pacakge metadata",
|
||||
"type": "patch"
|
||||
}
|
||||
],
|
||||
"packageName": "@azure-tools/extension",
|
||||
"email": "tiguerin@microsoft.com"
|
||||
}
|
|
@ -43,6 +43,7 @@
|
|||
"@azure-tools/async-io": "~3.0.0",
|
||||
"@azure-tools/eventing": "~3.0.0",
|
||||
"@azure-tools/tasks": "~3.0.0",
|
||||
"@azure/logger": "^1.0.2",
|
||||
"command-exists": "~1.2.9",
|
||||
"npm-normalize-package-bin": "1.0.1",
|
||||
"npm-package-arg": "^8.1.0",
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import { createClientLogger } from "@azure/logger";
|
||||
|
||||
export const logger = createClientLogger("@azure-tools/extension");
|
|
@ -30,6 +30,7 @@ import {
|
|||
MissingStartCommandException,
|
||||
UnsatisfiedSystemRequirementException,
|
||||
} from "./exceptions";
|
||||
import { logger } from "./logger";
|
||||
|
||||
function quoteIfNecessary(text: string): string {
|
||||
if (text && text.indexOf(" ") > -1 && text.charAt(0) != '"') {
|
||||
|
@ -124,7 +125,8 @@ async function fetchPackageMetadata(spec: string): Promise<any> {
|
|||
"registry": process.env.autorest_registry || "https://registry.npmjs.org",
|
||||
"full-metadata": true,
|
||||
});
|
||||
} catch (er) {
|
||||
} catch (error) {
|
||||
logger.error(`Error resolving package ${spec}`, error);
|
||||
throw new UnresolvedPackageException(spec);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче