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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/task.ts +8 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yeow-api",
3
- "version": "0.2.43",
4
- "description": "Yeow API �?TypeScript OOP wrappers over the task protocol",
3
+ "version": "0.2.44",
4
+ "description": "Yeow API",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
7
7
  "types": "./src/index.ts",
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 e = new Error(result.err);
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 += '\n --- cb registered at ---\n' + s;
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
  });