AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
ErrorTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_ERRORTYPES_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_ERRORTYPES_H_
18 
19 #include <ostream>
20 #include <string>
21 
22 namespace alexaClientSDK {
23 namespace avsCommon {
24 namespace utils {
25 namespace mediaPlayer {
26 
28 enum class ErrorType {
30  NONE,
83 };
84 
92  switch (errorType) {
93  case ErrorType::NONE:
94  return "NONE";
96  return "MEDIA_ERROR_UNKNOWN";
98  return "MEDIA_ERROR_INVALID_REQUEST";
100  return "MEDIA_ERROR_SERVICE_UNAVAILABLE";
102  return "MEDIA_ERROR_INTERNAL_SERVER_ERROR";
104  return "MEDIA_ERROR_INTERNAL_DEVICE_ERROR";
106  return "MEDIA_ERROR_HTTP_BAD_REQUEST";
108  return "MEDIA_ERROR_HTTP_UNAUTHORIZED";
110  return "MEDIA_ERROR_HTTP_FORBIDDEN";
112  return "MEDIA_ERROR_HTTP_NOT_FOUND";
114  return "MEDIA_ERROR_HTTP_CONFLICT";
116  return "MEDIA_ERROR_HTTP_INVALID_RANGE";
118  return "MEDIA_ERROR_HTTP_TOO_MANY_REQUESTS";
120  return "MEDIA_ERROR_HTTP_BAD_GATEWAY";
122  return "MEDIA_ERROR_HTTP_SERVICE_UNAVAILABLE";
124  return "MEDIA_ERROR_HTTP_GATEWAY_TIMEOUT";
126  return "MEDIA_ERROR_TIMED_OUT";
128  return "MEDIA_ERROR_URL_MALFORMED";
130  return "MEDIA_ERROR_COULD_NOT_RESOLVE_HOST";
132  return "MEDIA_ERROR_COULD_NOT_CONNECT";
134  return "MEDIA_ERROR_NOT_SEEKABLE";
136  return "MEDIA_ERROR_UNSUPPORTED";
138  return "MEDIA_ERROR_TEXT_PLAYBACK";
140  return "MEDIA_ERROR_IO";
142  return "MEDIA_ERROR_INVALID_COMMAND";
144  return "MEDIA_ERROR_PLAYLIST_ERROR";
146  return "MEDIA_ERROR_DECRYPTION_FLOW";
147  }
148  return "unknown ErrorType";
149 }
150 
158 inline std::ostream& operator<<(std::ostream& stream, const ErrorType& errorType) {
159  return stream << errorTypeToString(errorType);
160 }
161 
162 } // namespace mediaPlayer
163 } // namespace utils
164 } // namespace avsCommon
165 } // namespace alexaClientSDK
166 
167 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_UTILS_INCLUDE_AVSCOMMON_UTILS_MEDIAPLAYER_ERRORTYPES_H_
std::string errorTypeToString(ErrorType errorType)
Definition: ErrorTypes.h:91
::std::string string
Definition: gtest-port.h:1097
The server recognized the request as being malformed (bad request, unauthorized, forbidden, not found, etc).
The server accepted the request, but was unable to process the request as expected.
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
ErrorType
Identifies the specific type of error in a PlaybackFailed event.
Definition: ErrorTypes.h:28
std::ostream & operator<<(std::ostream &stream, const ErrorType &errorType)
Definition: ErrorTypes.h:158

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0