mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
hydrojudge intergration
This commit is contained in:
1 parent
2a09213f5d
commit
6b88570bd6
24 files changed
+1719
-9
No files matched your search
@@ -0,0 +1,69 @@
|
||||
import { STATUS_TEXTS } from 'hydrooj/dist/model/builtin';
|
||||
|
||||
export class CompileError extends Error {
|
||||
stdout: string;
|
||||
|
||||
stderr: string;
|
||||
|
||||
status: string;
|
||||
|
||||
type: string;
|
||||
|
||||
constructor(obj) {
|
||||
super('Compile Error');
|
||||
if (typeof obj === 'string') {
|
||||
this.stdout = obj;
|
||||
this.stderr = '';
|
||||
} else {
|
||||
this.stdout = obj.stdout || '';
|
||||
this.stderr = obj.stderr || '';
|
||||
this.status = obj.status ? STATUS_TEXTS[obj.status] || '' : '';
|
||||
}
|
||||
this.type = 'CompileError';
|
||||
}
|
||||
}
|
||||
|
||||
export class FormatError extends Error {
|
||||
type: string;
|
||||
|
||||
params: any[];
|
||||
|
||||
constructor(message, params = []) {
|
||||
super(message);
|
||||
this.type = 'FormatError';
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
export class RuntimeError extends Error {
|
||||
type: string;
|
||||
|
||||
detail: any;
|
||||
|
||||
constructor(detail, message) {
|
||||
super(message);
|
||||
this.type = 'RuntimeError';
|
||||
this.detail = detail;
|
||||
}
|
||||
}
|
||||
|
||||
export class SystemError extends Error {
|
||||
type: string;
|
||||
|
||||
params: any[];
|
||||
|
||||
constructor(message: string, params = []) {
|
||||
super(message);
|
||||
this.type = 'SystemError';
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
export class TooFrequentError extends Error {
|
||||
type: string;
|
||||
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.type = 'TooFrequentError';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user