@owlmeans/error 0.1.6 → 0.1.8
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/README.md
CHANGED
|
@@ -74,3 +74,20 @@ type ValueOrError<T> = T | ResilientError
|
|
|
74
74
|
## Related Packages
|
|
75
75
|
|
|
76
76
|
- [`@owlmeans/context`](../context) — context and services that propagate errors through the app
|
|
77
|
+
|
|
78
|
+
<!-- owlmeans:agent-guidance:start -->
|
|
79
|
+
## Agent guidance
|
|
80
|
+
|
|
81
|
+
This package ships embedded Claude Code skills and GitHub Copilot instructions under
|
|
82
|
+
`agent-meta/`. After installing your `@owlmeans/*` packages, run the OwlMeans
|
|
83
|
+
agent-skills installer to place them into your project's native locations
|
|
84
|
+
(`.claude/skills/` and `.github/instructions/`):
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
npx @owlmeans/agent-skills
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The embedded files are version-matched to this package release. Do not edit them
|
|
91
|
+
directly — they are regenerated on each publish. To contribute guidance edits,
|
|
92
|
+
open a PR against the source monorepo.
|
|
93
|
+
<!-- owlmeans:agent-guidance:end -->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "How to use @owlmeans/error — base error classes (ResilientError), error normalization, and i18n-aware error types. Use when importing from this package or defining typed framework errors."
|
|
3
|
+
applyTo: "**/*.ts, **/*.tsx"
|
|
4
|
+
---
|
|
5
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
6
|
+
|
|
7
|
+
# @owlmeans/error
|
|
8
|
+
|
|
9
|
+
**Layer:** Core
|
|
10
|
+
**Install:** `"@owlmeans/error": "^0.1.8"` in `dependencies`
|
|
11
|
+
|
|
12
|
+
## Key Exports
|
|
13
|
+
|
|
14
|
+
| Export | Description |
|
|
15
|
+
|--------|-------------|
|
|
16
|
+
| `ResilientError` | Base error class — all framework errors extend this |
|
|
17
|
+
| `ErrorNormalizer` | Normalize unknown errors into ResilientError instances |
|
|
18
|
+
| `ErrorTypes` | Built-in error type aliases |
|
|
19
|
+
| i18n helpers | Resolve error messages through the i18n layer |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Subclass `ResilientError` for typed framework errors:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { ResilientError } from '@owlmeans/error'
|
|
27
|
+
|
|
28
|
+
export class AgentApiError extends ResilientError {
|
|
29
|
+
public static override typeName = 'AgentApiError'
|
|
30
|
+
public constructor(message: string = 'unknown') {
|
|
31
|
+
super(AgentApiError.typeName, `agent-api:${message}`)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
throw new AgentApiError('rate-limited')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Depends On
|
|
39
|
+
|
|
40
|
+
- `@owlmeans/i18n` — for resolving error messages by key
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"package": "@owlmeans/error",
|
|
4
|
+
"version": "0.1.8",
|
|
5
|
+
"generatedAt": "2026-06-11T16:30:27.180Z",
|
|
6
|
+
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
|
+
"entries": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "skill",
|
|
10
|
+
"name": "error",
|
|
11
|
+
"category": "package-specific",
|
|
12
|
+
"file": "skills/error/SKILL.md",
|
|
13
|
+
"canonicalPath": ".claude/skills/error/SKILL.md"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"kind": "instruction",
|
|
17
|
+
"name": "error",
|
|
18
|
+
"category": "package-specific",
|
|
19
|
+
"file": "instructions/error.instructions.md",
|
|
20
|
+
"canonicalPath": ".github/instructions/error.instructions.md"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: error
|
|
3
|
+
description: How to use @owlmeans/error — base error classes (ResilientError), error normalization, and i18n-aware error types. Auto-invoked when importing from this package or throwing/catching framework errors.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
7
|
+
|
|
8
|
+
# @owlmeans/error
|
|
9
|
+
|
|
10
|
+
**Layer:** Core
|
|
11
|
+
**Install:** `"@owlmeans/error": "^0.1.8"` in `dependencies`
|
|
12
|
+
|
|
13
|
+
## Key Exports
|
|
14
|
+
|
|
15
|
+
| Export | Description |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| `ResilientError` | Base error class — all framework errors extend this |
|
|
18
|
+
| `ErrorNormalizer` | Normalize unknown errors into ResilientError instances |
|
|
19
|
+
| `ErrorTypes` | Built-in error type aliases |
|
|
20
|
+
| i18n helpers | Resolve error messages through the i18n layer |
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Subclass `ResilientError` for typed framework errors with i18n-resolvable messages:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { ResilientError } from '@owlmeans/error'
|
|
28
|
+
|
|
29
|
+
export class AgentApiError extends ResilientError {
|
|
30
|
+
public static override typeName = 'AgentApiError'
|
|
31
|
+
public constructor(message: string = 'unknown') {
|
|
32
|
+
super(AgentApiError.typeName, `agent-api:${message}`)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// In a handler:
|
|
37
|
+
throw new AgentApiError('rate-limited')
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Catch and normalize:
|
|
41
|
+
```typescript
|
|
42
|
+
import { ErrorNormalizer } from '@owlmeans/error'
|
|
43
|
+
try { ... } catch (e) {
|
|
44
|
+
const err = ErrorNormalizer.normalize(e)
|
|
45
|
+
// err is now a ResilientError with stable .type and .message
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Depends On
|
|
50
|
+
|
|
51
|
+
- `@owlmeans/i18n` — for resolving error messages by key
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/error",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owlmeans/i18n": "^0.1.
|
|
24
|
+
"@owlmeans/i18n": "^0.1.8"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@owlmeans/dep-config": "workspace:*",
|