forked from ReactiveDB/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ae2a64
commit 0569375
Showing
63 changed files
with
2,475 additions
and
1,995 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
export class ReactiveDBException extends Error { | ||
|
||
constructor(message: string) { | ||
super(message) | ||
this.name = 'ReactiveDBError'; | ||
(Object as any).setPrototypeOf(this, ReactiveDBException.prototype) | ||
this.name = 'ReactiveDBError' | ||
Object.setPrototypeOf(this, ReactiveDBException.prototype) | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,46 +1,40 @@ | ||
import { ReactiveDBException } from './Exception' | ||
|
||
export const NonExistentTable = | ||
(tableName: string) => new ReactiveDBException(`Table: \`${tableName}\` cannot be found.`) | ||
export const NonExistentTable = (tableName: string) => | ||
new ReactiveDBException(`Table: \`${tableName}\` cannot be found.`) | ||
|
||
export const UnmodifiableTable = | ||
() => new ReactiveDBException(`Method: defineSchema cannot be invoked since schema is existed or database is connected`) | ||
export const UnmodifiableTable = () => | ||
new ReactiveDBException(`Method: defineSchema cannot be invoked since schema is existed or database is connected`) | ||
|
||
export const InvalidQuery = | ||
() => new ReactiveDBException('Only navigation properties were included in query.') | ||
export const InvalidQuery = () => new ReactiveDBException('Only navigation properties were included in query.') | ||
|
||
export const AliasConflict = | ||
(column: string, tableName: string) => new ReactiveDBException(`Definition conflict, Column: \`${column}\` on table: ${tableName}.`) | ||
export const AliasConflict = (column: string, tableName: string) => | ||
new ReactiveDBException(`Definition conflict, Column: \`${column}\` on table: ${tableName}.`) | ||
|
||
export const GraphFailed = | ||
(err: Error) => new ReactiveDBException(`Graphify query result failed, due to: ${err.message}.`) | ||
export const GraphFailed = (err: Error) => | ||
new ReactiveDBException(`Graphify query result failed, due to: ${err.message}.`) | ||
|
||
export const NotImplemented = | ||
() => new ReactiveDBException('Not implemented yet.') | ||
export const NotImplemented = () => new ReactiveDBException('Not implemented yet.') | ||
|
||
export const UnexpectedRelationship = | ||
() => new ReactiveDBException('Unexpected relationship was specified.') | ||
export const UnexpectedRelationship = () => new ReactiveDBException('Unexpected relationship was specified.') | ||
|
||
export const InvalidType = | ||
(expect?: [string, string]) => { | ||
let message = 'Unexpected data type' | ||
if (expect) { | ||
message += `, expect ${expect[0]} but got ${expect[1]}` | ||
} | ||
return new ReactiveDBException(message + '.') | ||
export const InvalidType = (expect?: [string, string]) => { | ||
let message = 'Unexpected data type' | ||
if (expect) { | ||
message += `, expect ${expect[0]} but got ${expect[1]}` | ||
} | ||
return new ReactiveDBException(message + '.') | ||
} | ||
|
||
export const UnexpectedTransactionUse = | ||
() => new ReactiveDBException('Please use Database#transaction to get a transaction scope first.') | ||
export const UnexpectedTransactionUse = () => | ||
new ReactiveDBException('Please use Database#transaction to get a transaction scope first.') | ||
|
||
export const PrimaryKeyNotProvided = | ||
() => new ReactiveDBException(`Primary key was not provided.`) | ||
export const PrimaryKeyNotProvided = () => new ReactiveDBException(`Primary key was not provided.`) | ||
|
||
export const PrimaryKeyConflict = | ||
() => new ReactiveDBException(`Primary key was already provided.`) | ||
export const PrimaryKeyConflict = () => new ReactiveDBException(`Primary key was already provided.`) | ||
|
||
export const DatabaseIsNotEmpty = | ||
() => new ReactiveDBException('Method: load cannnot be invoked since database is not empty.') | ||
export const DatabaseIsNotEmpty = () => | ||
new ReactiveDBException('Method: load cannnot be invoked since database is not empty.') | ||
|
||
export const NotConnected = | ||
() => new ReactiveDBException('Method: dispose cannnot be invoked before database is connected.') | ||
export const NotConnected = () => | ||
new ReactiveDBException('Method: dispose cannnot be invoked before database is connected.') |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import { ReactiveDBException } from './Exception' | ||
|
||
export const TokenConsumed = | ||
() => new ReactiveDBException('QueryToken was already consumed.') | ||
export const TokenConsumed = () => new ReactiveDBException('QueryToken was already consumed.') | ||
|
||
export const TokenConcatFailed = | ||
(msg?: string) => { | ||
const errMsg = 'Token cannot be concated' + `${ msg ? ' due to: ' + msg : '' }.` | ||
return new ReactiveDBException(errMsg) | ||
} | ||
export const TokenConcatFailed = (msg?: string) => { | ||
const errMsg = 'Token cannot be concated' + `${msg ? ' due to: ' + msg : ''}.` | ||
return new ReactiveDBException(errMsg) | ||
} |
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
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.