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 1
1
/*
2
- * Copyright (C) 2019-2024 HERE Europe B.V.
2
+ * Copyright (C) 2019-2025 HERE Europe B.V.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -109,6 +109,18 @@ class CORE_API ApiError {
109
109
return {ErrorCode::CacheIO, description};
110
110
}
111
111
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
+
112
124
/* *
113
125
* @brief Creates the `ApiError` instance with the unknown error code and
114
126
* description.
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (C) 2019-2024 HERE Europe B.V.
2
+ * Copyright (C) 2019-2025 HERE Europe B.V.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -96,6 +96,11 @@ enum class ErrorCode {
96
96
* The device is full and cannot store more data.
97
97
*/
98
98
NoSpaceLeft,
99
+
100
+ /* *
101
+ * Absence of network connectivity.
102
+ */
103
+ Offline,
99
104
};
100
105
101
106
} // namespace client
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (C) 2019-2021 HERE Europe B.V.
2
+ * Copyright (C) 2019-2025 HERE Europe B.V.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -154,6 +154,7 @@ class CORE_API HttpStatusCode {
154
154
if (http_code < 0 ) {
155
155
switch (static_cast <olp::http::ErrorCode>(http_code)) {
156
156
case olp::http::ErrorCode::OFFLINE_ERROR:
157
+ return olp::client::ErrorCode::Offline;
157
158
case olp::http::ErrorCode::IO_ERROR:
158
159
return olp::client::ErrorCode::NetworkConnection;
159
160
case olp::http::ErrorCode::TIMEOUT_ERROR:
You can’t perform that action at this time.
0 commit comments