Fixed git modules
parent
5df48b0bbf
commit
34bc5d9bb3
|
@ -7,3 +7,6 @@
|
|||
[submodule "vendor/TeaEventBus"]
|
||||
path = vendor/TeaEventBus
|
||||
url = https://github.com/WolverinDEV/TeaEventBus.git
|
||||
[submodule "vendor\\TeaClientServices"]
|
||||
path = vendor\\TeaClientServices
|
||||
url = https://github.com/WolverinDEV/TeaClientServices.git
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit f9267daa208f7f97a7bc56d52b89dac7cc0004e7
|
|
@ -1,34 +0,0 @@
|
|||
import {MessageCommandErrorResult} from "./Messages";
|
||||
import {clientServiceLogger} from "./Logging";
|
||||
|
||||
export type ActionResult<T> = {
|
||||
unwrap() : T;
|
||||
} & ({
|
||||
status: "success",
|
||||
result: T
|
||||
} | {
|
||||
status: "error",
|
||||
result: MessageCommandErrorResult
|
||||
});
|
||||
|
||||
|
||||
export function createErrorResult<T>(result: MessageCommandErrorResult) : ActionResult<T> {
|
||||
return {
|
||||
status: "error",
|
||||
result: result,
|
||||
unwrap(): T {
|
||||
clientServiceLogger.logError("Tried to unwrap an action which failed: %o", result);
|
||||
throw "action failed with " + result.type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function createResult<T>(result: T) : ActionResult<T> {
|
||||
return {
|
||||
status: "success",
|
||||
result: result,
|
||||
unwrap(): T {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 9caad3399af830606e25e66f51ee40239bc3b457
|
||||
Subproject commit 8310382d8a851b2e7095b400807141065811da53
|
Loading…
Reference in New Issue