redirect users about missing publisher

This commit is contained in:
Joao Moreno 2018-10-01 15:28:05 +02:00
parent 5e4a865fa6
commit fae9b7d125

View file

@ -4,11 +4,11 @@ const nameRegex = /^[a-z0-9][a-z0-9\-]*$/i;
export function validatePublisher(publisher: string): void {
if (!publisher) {
throw new Error(`Missing publisher name`);
throw new Error(`Missing publisher name. Learn more: https://code.visualstudio.com/docs/extensions/publish-extension#_publishing-extensions`);
}
if (!nameRegex.test(publisher)) {
throw new Error(`Invalid publisher name '${publisher}'. Expected the identifier of a publisher, not its human-friendly name.`);
throw new Error(`Invalid publisher name '${publisher}'. Expected the identifier of a publisher, not its human-friendly name. Learn more: https://code.visualstudio.com/docs/extensions/publish-extension#_publishing-extensions`);
}
}