Skip to content

Commit

Permalink
fix: detect expired PAT
Browse files Browse the repository at this point in the history
closes #466
  • Loading branch information
joaomoreno committed Nov 2, 2021
1 parent 12e787d commit 19f51dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/publish.ts
Expand Up @@ -137,7 +137,9 @@ async function _publish(packagePath: string, manifest: Manifest, options: IInter
} catch (err) {
const message = (err && err.message) || '';

if (/Invalid Resource/.test(message)) {
if (/Personal Access Token used has expired/.test(message)) {
err.message = `${err.message}\n\nYou're using an expired Personal Access Token, please get a new PAT.\nMore info: https://aka.ms/vscodepat`;
} else if (/Invalid Resource/.test(message)) {
err.message = `${err.message}\n\nYou're likely using an expired Personal Access Token, please get a new PAT.\nMore info: https://aka.ms/vscodepat`;
}

Expand Down

0 comments on commit 19f51dc

Please sign in to comment.