{"version":3,"file":"agent/agents/errors.mjs","sources":["webpack://@agent-infra/browser-use/./src/agent/agents/errors.ts"],"sourcesContent":["/**\n * The following code is modified based on\n * https://github.com/nanobrowser/nanobrowser/blob/master/chrome-extension/src/background/agent/agents/errors.ts\n *\n * Apache-2.0 License\n * Copyright (c) 2024 alexchenzl\n * https://github.com/nanobrowser/nanobrowser/blob/master/LICENSE\n */\n\n/**\n * Custom error class for chat model authentication errors\n */\nexport class ChatModelAuthError extends Error {\n  /**\n   * Creates a new ChatModelAuthError\n   *\n   * @param message - The error message\n   * @param cause - The original error that caused this error\n   */\n  constructor(\n    message: string,\n    public readonly cause?: unknown,\n  ) {\n    super(message);\n    this.name = 'ChatModelAuthError';\n\n    // Maintains proper stack trace for where our error was thrown\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, ChatModelAuthError);\n    }\n  }\n\n  /**\n   * Returns a string representation of the error\n   */\n  toString(): string {\n    return `${this.name}: ${this.message}${this.cause ? ` (Caused by: ${this.cause})` : ''}`;\n  }\n}\n"],"names":["ChatModelAuthError","Error","message","cause"],"mappings":";;;;AAWC;;;;;;;;;;AACM,MAAMA,2BAA2BC;IAuBtC,WAAmB;QACjB,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI;IAC1F;IAlBA,YACEC,OAAe,EACCC,KAAe,CAC/B;QACA,KAAK,CAACD,UAAAA,iBAAAA,IAAAA,EAAAA,SAAAA,KAAAA,IAAAA,IAAAA,CAFUC,KAAK,GAALA;QAGhB,IAAI,CAAC,IAAI,GAAG;QAGZ,IAAIF,MAAM,iBAAiB,EACzBA,MAAM,iBAAiB,CAAC,IAAI,EAAED;IAElC;AAQF"}