-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch errors from git being absent and continue on as best possible (#…
…173) * update to the latest lock file * handle git errors in commit phase * Update serious-snakes-reply.md * Update README.md * Update soft-teachers-help.md * Update package.json
- Loading branch information
1 parent
f63b652
commit 94de7c1
Showing
9 changed files
with
240 additions
and
8,677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@changesets/errors': minor | ||
--- | ||
|
||
Create package with `GitError` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@changesets/cli': patch | ||
--- | ||
|
||
Catch errors from git being absent and continue on as best possible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @changesets/errors | ||
|
||
Error classes for Changesets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "@changesets/errors", | ||
"version": "0.0.0", | ||
"description": "Error classes for @changesets", | ||
"main": "dist/errors.cjs.js", | ||
"module": "dist/errors.esm.js", | ||
"license": "MIT", | ||
"repository": "https://github.com/changesets/changesets/tree/master/packages/errors" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { GitError } from "./index"; | ||
|
||
describe("Error classes", () => { | ||
describe("GitError class", () => { | ||
let error: GitError; | ||
beforeEach(() => { | ||
error = new GitError(1, "Operation failed"); | ||
}); | ||
it("should be an instance of error", () => { | ||
expect(error).toBeInstanceOf(Error); | ||
}); | ||
it("should include error message and exit code in error", () => { | ||
expect(error.toString()).toMatch(/(Operation failed).*(1)/); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class GitError extends Error { | ||
constructor(exitCode: number, message: string) { | ||
super(`Error: Git - ${message}, exit code: ${exitCode}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.