yeow-api 0.2.43 → 0.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/task.ts +8 -2
package/package.json
CHANGED
package/src/task.ts
CHANGED
|
@@ -6,11 +6,17 @@ export function post<T = unknown>(
|
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
const cbId = _registerCallback((result: any) => {
|
|
8
8
|
if (result?.err) {
|
|
9
|
-
const
|
|
9
|
+
const msg = result.type ? `[${result.type}] ${result.err}` : result.err;
|
|
10
|
+
const e = new Error(msg);
|
|
10
11
|
if ($dev && typeof _getCurrentCbStack === 'function') {
|
|
11
12
|
const s = _getCurrentCbStack();
|
|
12
|
-
if (s) e.stack += '
|
|
13
|
+
if (s) e.stack += ' --- cb registered at ---\n' + s;
|
|
13
14
|
}
|
|
15
|
+
if (result.stack) {
|
|
16
|
+
e.stack += '\n --- Java stack ---\n' + result.stack;
|
|
17
|
+
}
|
|
18
|
+
(e as any).javaType = result.type || null;
|
|
19
|
+
(e as any).taskType = result.task || null;
|
|
14
20
|
reject(e);
|
|
15
21
|
} else resolve(result as T);
|
|
16
22
|
});
|