Skip to content

Commit e5c087f

Browse files
move errors into top-level imports
1 parent 0acdab7 commit e5c087f

34 files changed

Lines changed: 88 additions & 17 deletions

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-essentials",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "A collection of essential Git commands for your browser and Node.js",
55
"main": "dist/esm/index.js",
66
"types": "index.d.ts",

src/api/merge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export type MergeResult = {
8282
* ## Limitations
8383
*
8484
* Currently it does not support incomplete merges. That is, if there are merge conflicts it cannot solve
85-
* with the built in diff3 algorithm it will not modify the working dir, and will throw a {@link Errors.MergeNotSupportedError} error.
85+
* with the built in diff3 algorithm it will not modify the working dir, and will throw a {@link MergeNotSupportedError} error.
8686
*
8787
* Currently it will fail if multiple candidate merge bases are found. (It doesn't yet implement the recursive merge strategy.)
8888
*

src/errors/AlreadyExistsError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export type AlreadyExistsErrorData = {
88
canForce: boolean
99
}
1010

11+
/**
12+
* @group Errors
13+
*/
1114
export class AlreadyExistsError extends BaseError<AlreadyExistsErrorData> {
1215
public static readonly code = 'AlreadyExistsError'
1316

src/errors/BaseError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export type ErrorDto<T> = {
66
stack?: string
77
}
88

9+
/**
10+
* @group Errors
11+
*/
912
export class BaseError<T> extends Error {
1013
caller: string
1114

src/errors/CheckoutConflictError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export type CheckoutConflictErrorData = {
44
filepaths: string[]
55
}
66

7+
/**
8+
* @group Errors
9+
*/
710
export class CheckoutConflictError extends BaseError<CheckoutConflictErrorData> {
811
public static readonly code = 'CheckoutConflictError'
912

src/errors/CommitNotFetchedError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export type CommitNotFetchedErrorData = {
55
oid: string
66
}
77

8+
/**
9+
* @group Errors
10+
*/
811
export class CommitNotFetchedError extends BaseError<CommitNotFetchedErrorData> {
912
public static readonly code = 'CommitNotFetchedError'
1013

src/errors/EmptyServerResponseError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { BaseError } from './BaseError'
22

3+
/**
4+
* @group Errors
5+
*/
36
export class EmptyServerResponseError extends BaseError<void> {
47
public static readonly code = 'EmptyServerResponseError'
58

src/errors/FastForwardError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { BaseError } from './BaseError'
22

3+
/**
4+
* @group Errors
5+
*/
36
export class FastForwardError extends BaseError<void> {
47
public static readonly code = 'FastForwardError'
58

src/errors/GitPushError.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import { HttpHeaders } from '../models'
1+
import { PushResult } from '..'
22
import { BaseError } from './BaseError'
33

4-
export type PushResult = {
5-
ok: boolean
6-
error?: string
7-
refs: { [key: string]: { ok: boolean, error?: string } }
8-
headers?: HttpHeaders
9-
}
104

115
export type GitPushErrorData = {
126
prettyDetails: string
137
result: PushResult
148
}
159

10+
/**
11+
* @group Errors
12+
*/
1613
export class GitPushError extends BaseError<GitPushErrorData> {
1714
public static readonly code = 'GitPushError'
1815

src/errors/HttpError.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export type HttpErrorData = {
66
response?: string
77
}
88

9+
/**
10+
* @group Errors
11+
*/
912
export class HttpError extends BaseError<HttpErrorData> {
1013
public static readonly code = 'HttpError'
1114

0 commit comments

Comments
 (0)