File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
olp-cpp-sdk-core/include/olp/core Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2019-2024 HERE Europe B.V.
2+ * Copyright (C) 2019-2025 HERE Europe B.V.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -109,6 +109,18 @@ class CORE_API ApiError {
109109 return {ErrorCode::CacheIO, description};
110110 }
111111
112+ /* *
113+ * @brief Creates the `ApiError` instance with the offline error code and
114+ * description.
115+ *
116+ * @param description The optional description.
117+ *
118+ * @return The `ApiError` instance.
119+ */
120+ static ApiError Offline (const char * description = " Offline" ) {
121+ return {ErrorCode::Offline, description};
122+ }
123+
112124 /* *
113125 * @brief Creates the `ApiError` instance with the unknown error code and
114126 * description.
Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2019-2024 HERE Europe B.V.
2+ * Copyright (C) 2019-2025 HERE Europe B.V.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -96,6 +96,11 @@ enum class ErrorCode {
9696 * The device is full and cannot store more data.
9797 */
9898 NoSpaceLeft,
99+
100+ /* *
101+ * Absence of network connectivity.
102+ */
103+ Offline,
99104};
100105
101106} // namespace client
Original file line number Diff line number Diff line change 11/*
2- * Copyright (C) 2019-2021 HERE Europe B.V.
2+ * Copyright (C) 2019-2025 HERE Europe B.V.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -154,6 +154,7 @@ class CORE_API HttpStatusCode {
154154 if (http_code < 0 ) {
155155 switch (static_cast <olp::http::ErrorCode>(http_code)) {
156156 case olp::http::ErrorCode::OFFLINE_ERROR:
157+ return olp::client::ErrorCode::Offline;
157158 case olp::http::ErrorCode::IO_ERROR:
158159 return olp::client::ErrorCode::NetworkConnection;
159160 case olp::http::ErrorCode::TIMEOUT_ERROR:
You can’t perform that action at this time.
0 commit comments