mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-27 00:17:29 +00:00
refactor: dedupe provider bootstrap error formatting
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { ProviderPrepareRuntimeAuthContext } from "openclaw/plugin-sdk/core";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import { ensureAuthProfileStore } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { getAccessTokenResultAsync } from "./cli.js";
|
||||
import {
|
||||
@@ -95,7 +96,7 @@ export async function prepareFoundryRuntimeAuth(ctx: ProviderPrepareRuntimeAuthC
|
||||
...(baseUrl ? { baseUrl } : {}),
|
||||
};
|
||||
} catch (err) {
|
||||
const details = err instanceof Error ? err.message : String(err);
|
||||
const details = formatErrorMessage(err);
|
||||
throw new Error(`Failed to refresh Azure Entra ID token via az CLI: ${details}`, {
|
||||
cause: err,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user