refactor: use shared getErrorMessage() and deduplicate OAuth CSS (#2348)

Replace 4 inline `err instanceof Error ? err.message : String(err)`
patterns in aws.ts, digitalocean.ts, and hetzner.ts with the shared
getErrorMessage() helper. The shared helper uses duck-typing which is
more robust across realms/prototypes than instanceof checks.

Export OAUTH_CSS from shared/oauth.ts and import it in
digitalocean/digitalocean.ts instead of duplicating the 250+ char
CSS string.

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-08 10:42:08 -07:00 committed by GitHub
parent 8ac2ae366f
commit 4396703615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 11 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.15.20",
"version": "0.15.21",
"type": "module",
"bin": {
"spawn": "cli.js"