Pipecat C++ Client SDK 1.0.0
Connect native apps to Pipecat bots
Loading...
Searching...
No Matches
errors.h
Go to the documentation of this file.
1//
2// Copyright (c) 2024-2026, Daily
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6
9
10#ifndef PIPECAT_ERRORS_H
11#define PIPECAT_ERRORS_H
12
13#include <stdexcept>
14#include <string>
15
16namespace pipecat {
17
19class PipecatError : public std::runtime_error {
20 public:
21 using std::runtime_error::runtime_error;
22};
23
26 public:
29 explicit StartBotError(const std::string& message, int status = 0)
30 : PipecatError(message), _status(status) {}
31
33 int status() const { return _status; }
34
35 private:
36 int _status;
37};
38
41 public:
44 const std::string& message =
45 "Bot did not become ready within the connect timeout"
46 )
47 : PipecatError(message) {}
48};
49
52 public:
55 const std::string& message = "Unable to connect the transport"
56 )
57 : PipecatError(message) {}
58};
59
63 public:
66 const std::string& message = "Invalid transport connection params"
67 )
68 : PipecatError(message) {}
69};
70
74 public:
77 const std::string& message =
78 "Bot is not ready, call connect() first"
79 )
80 : PipecatError(message) {}
81};
82
86 public:
89 const std::string& message =
90 "Client already started, call disconnect() first"
91 )
92 : PipecatError(message) {}
93};
94
97 public:
101 const std::string& feature,
102 const std::string& message = ""
103 )
104 : PipecatError(
105 feature + " not supported" +
106 (message.empty() ? "" : ": " + message)
107 ),
108 _feature(feature) {}
109
111 const std::string& feature() const { return _feature; }
112
113 private:
114 std::string _feature;
115};
116
120 public:
121 using PipecatError::PipecatError;
122};
123
127 public:
130 const std::string& message = "Timed out waiting for a response"
131 )
132 : MessageError(message) {}
133};
134
137 public:
140 const std::string& message =
141 "Message size exceeds the transport's limit"
142 )
143 : PipecatError(message) {}
144};
145
146} // namespace pipecat
147
148#endif
Definition errors.h:85
BotAlreadyStartedError(const std::string &message="Client already started, call disconnect() first")
Creates the error.
Definition errors.h:88
Definition errors.h:73
BotNotReadyError(const std::string &message="Bot is not ready, call connect() first")
Creates the error.
Definition errors.h:76
The bot didn't become ready in time. Thrown by PipecatClient::connect().
Definition errors.h:40
ConnectionTimeoutError(const std::string &message="Bot did not become ready within the connect timeout")
Creates the error.
Definition errors.h:43
InvalidTransportParamsError(const std::string &message="Invalid transport connection params")
Creates the error.
Definition errors.h:65
Definition errors.h:119
A message is too large for the transport.
Definition errors.h:136
MessageTooLargeError(const std::string &message="Message size exceeds the transport's limit")
Creates the error.
Definition errors.h:139
Base class of all the errors thrown by the client.
Definition errors.h:19
Definition errors.h:126
RequestTimeoutError(const std::string &message="Timed out waiting for a response")
Creates the error.
Definition errors.h:129
Starting the bot failed. Thrown by PipecatClient::start_bot().
Definition errors.h:25
int status() const
The HTTP status of the answer, or 0 if there was no answer.
Definition errors.h:33
StartBotError(const std::string &message, int status=0)
Definition errors.h:29
The transport couldn't connect. Thrown by Transport::connect().
Definition errors.h:51
TransportStartError(const std::string &message="Unable to connect the transport")
Creates the error.
Definition errors.h:54
The transport or the bot doesn't support a feature.
Definition errors.h:96
const std::string & feature() const
The feature that isn't supported, e.g. "DTMF".
Definition errors.h:111
UnsupportedFeatureError(const std::string &feature, const std::string &message="")
Definition errors.h:100
The Pipecat C++ client SDK.
Definition client.h:29