-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy patherrors.js
65 lines (56 loc) · 1.7 KB
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { DomainError } from '../../../shared/domain/errors.js';
class OrganizationLearnersCouldNotBeSavedError extends DomainError {
constructor(message = 'An error occurred during process') {
super(message);
}
}
class OrganizationDoesNotHaveFeatureEnabledError extends DomainError {
constructor(message = 'The organization does not have the feature enabled') {
super(message);
}
}
class SiecleXmlImportError extends DomainError {
constructor(code, meta) {
super('An error occurred during Siecle XML import');
this.code = code;
this.meta = meta;
}
}
class AggregateImportError extends DomainError {
constructor(meta) {
super('An error occurred during import validation');
this.meta = meta;
}
}
class OrganizationLearnerImportFormatNotFoundError extends DomainError {
constructor(organizationId) {
super(`organizationLearnerImportFormat not found for the organizationId ${organizationId}`);
}
}
class ReconcileCommonOrganizationLearnerError extends DomainError {
reason = null;
constructor(reason) {
super(`Can't reconcile user (${reason})`);
this.reason = reason;
}
}
class CouldNotDeleteLearnersError extends DomainError {
constructor() {
super(`Could not delete the following organization learners.`);
}
}
class OrganizationLearnerCertificabilityNotUpdatedError extends DomainError {
constructor(message) {
super(message);
}
}
export {
AggregateImportError,
CouldNotDeleteLearnersError,
OrganizationDoesNotHaveFeatureEnabledError,
OrganizationLearnerCertificabilityNotUpdatedError,
OrganizationLearnerImportFormatNotFoundError,
OrganizationLearnersCouldNotBeSavedError,
ReconcileCommonOrganizationLearnerError,
SiecleXmlImportError,
};