forked from requirejs/requirejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorHandler.js
More file actions
30 lines (26 loc) · 792 Bytes
/
errorHandler.js
File metadata and controls
30 lines (26 loc) · 792 Bytes
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
/*jslint strict: false */
/*global define, doh */
define(function (require) {
function onError(err) {
//If the err is a timeout then that means we should
//try a different require call.
if (err.requireType === 'timeout') {
var moduleId = err.requireModules[0].replace(/-typo/, '');
require([moduleId], function (value) {
//Run the test
doh.register(
"retryOnError",
[
function retryOnError(t) {
t.is("target", value.name);
}
]
);
doh.run();
});
} else {
throw err;
}
}
return onError;
});