mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Chrome extension: simplify validation logic
Use OR operator to require both Browser and Protocol-Version fields. Simplified catch block to generic error message since specific wrong-port cases are already handled by the validation blocks above.
This commit is contained in:
committed by
Peter Steinberger
parent
0a53a77dd6
commit
b7949d317f
@@ -87,6 +87,19 @@ async function checkRelayReachable(port, token) {
|
|||||||
`Relay not reachable/authenticated at http://127.0.0.1:${port}/. Start OpenClaw browser relay and verify token.`,
|
`Relay not reachable/authenticated at http://127.0.0.1:${port}/. Start OpenClaw browser relay and verify token.`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
const message = String(err || '').toLowerCase()
|
||||||
|
if (message.includes('json') || message.includes('syntax')) {
|
||||||
|
setStatus(
|
||||||
|
'error',
|
||||||
|
'Wrong port: this is not a relay endpoint. Use gateway port + 3 (for gateway 18789, relay is 18792).',
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
setStatus(
|
||||||
|
'error',
|
||||||
|
`Relay not reachable/authenticated at http://127.0.0.1:${port}/. Start OpenClaw browser relay and verify token.`,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user