-
Notifications
You must be signed in to change notification settings - Fork 31
/
plugin-init.js
36 lines (35 loc) · 1.07 KB
/
plugin-init.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
'use strict';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _require = require('./utils'),
CODES = _require.CODES;
var ERROR_MAP = (0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, CODES.SyncError, {
text: function text(context) {
return context.sourceMessage;
},
level: "ERROR",
type: "PLUGIN"
}), CODES.APIError, {
text: function text(context) {
return context.sourceMessage;
},
level: "ERROR",
type: "PLUGIN"
}), CODES.ImageAPIError, {
text: function text(context) {
return context.sourceMessage;
},
level: "ERROR",
type: "PLUGIN"
}), CODES.MissingDependencyError, {
text: function text(context) {
return context.sourceMessage;
},
level: "ERROR",
type: "PLUGIN"
});
exports.onPluginInit = function (_ref) {
var reporter = _ref.reporter;
reporter.setErrorMap(ERROR_MAP);
};
//# sourceMappingURL=plugin-init.js.map