/** * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Extracts a human-readable message from an error raised by an embedded flow call. * * Handles: * - `AsgardeoAPIError` (and any `Error`) whose message embeds the server's JSON error payload, * e.g. `Authorization request failed: {"code":"ABA-60007","message":"...","description":"..."}`. * - Errors that crossed a serialization boundary (such as a Next.js server action) and arrive as a plain * `Error` whose message is the stringified API error: * `[AsgardeoAPIError] (code="...") (HTTP 400 - Bad Request)\nMessage: ...`. * - Plain objects carrying `description` / `message` fields, and raw strings. * * @param error - The caught error. * @param fallback - Message to use when nothing meaningful can be extracted. * @returns A message suitable for showing to the user. */ declare const resolveFlowErrorMessage: (error: unknown, fallback: string) => string; export default resolveFlowErrorMessage; //# sourceMappingURL=resolveFlowErrorMessage.d.ts.map