@@ -16,6 +16,7 @@ import { listAgentWorkspaceDirs } from "../../agents/workspace-dirs.js";
1616import type { OpenClawConfig } from "../../config/config.js" ;
1717import { loadConfig , writeConfigFile } from "../../config/config.js" ;
1818import { fetchClawHubSkillDetail } from "../../infra/clawhub.js" ;
19+ import { formatErrorMessage } from "../../infra/errors.js" ;
1920import { getRemoteSkillEligibility } from "../../infra/skills-remote.js" ;
2021import { normalizeAgentId } from "../../routing/session-key.js" ;
2122import { normalizeSecretInput } from "../../utils/normalize-secret-input.js" ;
@@ -146,11 +147,7 @@ export const skillsHandlers: GatewayRequestHandlers = {
146147 } ) ;
147148 respond ( true , { results } , undefined ) ;
148149 } catch ( err ) {
149- respond (
150- false ,
151- undefined ,
152- errorShape ( ErrorCodes . UNAVAILABLE , err instanceof Error ? err . message : String ( err ) ) ,
153- ) ;
150+ respond ( false , undefined , errorShape ( ErrorCodes . UNAVAILABLE , formatErrorMessage ( err ) ) ) ;
154151 }
155152 } ,
156153 "skills.detail" : async ( { params, respond } ) => {
@@ -171,11 +168,7 @@ export const skillsHandlers: GatewayRequestHandlers = {
171168 } ) ;
172169 respond ( true , detail , undefined ) ;
173170 } catch ( err ) {
174- respond (
175- false ,
176- undefined ,
177- errorShape ( ErrorCodes . UNAVAILABLE , err instanceof Error ? err . message : String ( err ) ) ,
178- ) ;
171+ respond ( false , undefined , errorShape ( ErrorCodes . UNAVAILABLE , formatErrorMessage ( err ) ) ) ;
179172 }
180173 } ,
181174 "skills.install" : async ( { params, respond } ) => {
0 commit comments