mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 23:04:52 +09:00
Change config errors to be subclasses of RequestError (#895)
This prevents them from being logged when raised during an event handler.
This commit is contained in:
1 parent
3667b4733a
commit
7e82ad89ff
1 file changed
+4
-3
@@ -9,6 +9,7 @@ import * as libSchema from "../schema";
|
||||
import { StringEnum } from "../data/composites";
|
||||
import { safeOutputFile } from "../file_ops";
|
||||
import * as validators from "./validators";
|
||||
import { RequestError } from "../errors";
|
||||
|
||||
const ConfigLocation = StringEnum(["controller", "host", "control"]);
|
||||
export type ConfigLocation = Static<typeof ConfigLocation>;
|
||||
@@ -21,7 +22,7 @@ export type ConfigLocation = Static<typeof ConfigLocation>;
|
||||
*
|
||||
* @extends Error
|
||||
*/
|
||||
export class InvalidAccess extends Error { };
|
||||
export class InvalidAccess extends RequestError { };
|
||||
|
||||
/**
|
||||
* Invalid Value exception
|
||||
@@ -31,7 +32,7 @@ export class InvalidAccess extends Error { };
|
||||
*
|
||||
* @extends Error
|
||||
*/
|
||||
export class InvalidValue extends Error { };
|
||||
export class InvalidValue extends RequestError { };
|
||||
|
||||
/**
|
||||
* Invalid Field exception
|
||||
@@ -41,7 +42,7 @@ export class InvalidValue extends Error { };
|
||||
*
|
||||
* @extends Error
|
||||
*/
|
||||
export class InvalidField extends Error { };
|
||||
export class InvalidField extends RequestError { };
|
||||
|
||||
|
||||
const OldConfigGroupSchema = Type.Object({
|
||||
|
||||
Reference in new issue
Block a user