Skip to content

Commit

Permalink
Cast rapidjson errors to int for logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbirkner committed Feb 22, 2024
1 parent 684fecc commit 3856537
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cesium3DTilesContent/src/B3dmToGltfConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ rapidjson::Document parseFeatureTableJsonData(
result.errors.emplaceError(fmt::format(
"Error when parsing feature table JSON, error code {} at byte offset "
"{}",
(int)document.GetParseError(),
static_cast<int32_t>(document.GetParseError()),
document.GetErrorOffset()));
return document;
}
Expand Down Expand Up @@ -213,7 +213,7 @@ void convertB3dmMetadataToGltfStructuralMetadata(
"Error when parsing batch table JSON, error code {} at byte "
"offset "
"{}. Skip parsing metadata",
batchTableJson.GetParseError(),
static_cast<int32_t>(batchTableJson.GetParseError()),
batchTableJson.GetErrorOffset()));
return;
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesContent/src/PntsToGltfConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ rapidjson::Document parseFeatureTableJson(
parsedContent.errors.emplaceError(fmt::format(
"Error when parsing feature table JSON, error code {} at byte offset "
"{}",
document.GetParseError(),
static_cast<int32_t>(document.GetParseError()),
document.GetErrorOffset()));
return document;
}
Expand Down Expand Up @@ -783,7 +783,7 @@ rapidjson::Document parseBatchTableJson(
"Error when parsing batch table JSON, error code {} at byte "
"offset "
"{}. Skip parsing metadata",
document.GetParseError(),
static_cast<int32_t>(document.GetParseError()),
document.GetErrorOffset()));
return document;
}
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesContent/src/QuantizedMeshLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ static QuantizedMeshMetadataResult processMetadata(
if (metadata.HasParseError()) {
result.errors.emplaceError(fmt::format(
"Error when parsing metadata, error code {} at byte offset {}",
metadata.GetParseError(),
static_cast<int32_t>(metadata.GetParseError()),
metadata.GetErrorOffset()));
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ std::optional<std::string> getNewAccessToken(
pLogger,
"Error when parsing Cesium ion response, error code {} at byte offset "
"{}",
ionResponse.GetParseError(),
static_cast<int32_t>(ionResponse.GetParseError()),
ionResponse.GetErrorOffset());
return std::nullopt;
}
Expand Down Expand Up @@ -244,7 +244,7 @@ mainThreadHandleEndpointResponse(
result.errors.emplaceError(fmt::format(
"Error when parsing Cesium ion response JSON, error code {} at byte "
"offset {}",
ionResponse.GetParseError(),
static_cast<int32_t>(ionResponse.GetParseError()),
ionResponse.GetErrorOffset()));
return externals.asyncSystem.createResolvedFuture(std::move(result));
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ Future<LoadLayersResult> loadLayersRecursive(
loadLayersResult.errors.emplaceWarning(fmt::format(
"Error when parsing layer.json, error code {} at byte "
"offset {}",
layerJson.GetParseError(),
static_cast<int32_t>(layerJson.GetParseError()),
layerJson.GetErrorOffset()));
return asyncSystem.createResolvedFuture(
std::move(loadLayersResult));
Expand Down Expand Up @@ -490,7 +490,7 @@ Future<LoadLayersResult> loadLayerJson(
LoadLayersResult result;
result.errors.emplaceError(fmt::format(
"Error when parsing layer.json, error code {} at byte offset {}",
layerJson.GetParseError(),
static_cast<int32_t>(layerJson.GetParseError()),
layerJson.GetErrorOffset()));
return asyncSystem.createResolvedFuture(std::move(result));
}
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesSelection/src/TilesetContentManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ TilesetContentManager::TilesetContentManager(
result.errors.emplaceError(fmt::format(
"Error when parsing tileset JSON, error code {} at byte "
"offset {}",
tilesetJson.GetParseError(),
static_cast<int32_t>(tilesetJson.GetParseError()),
tilesetJson.GetErrorOffset()));
return asyncSystem.createResolvedFuture(std::move(result));
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTilesSelection/src/TilesetJsonLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ TileLoadResult parseExternalTilesetInWorkerThread(
SPDLOG_LOGGER_ERROR(
pLogger,
"Error when parsing tileset JSON, error code {} at byte offset {}",
tilesetJson.GetParseError(),
static_cast<int32_t>(tilesetJson.GetParseError()),
tilesetJson.GetErrorOffset());
return TileLoadResult::createFailedResult(std::move(pCompletedRequest));
}
Expand Down Expand Up @@ -782,7 +782,7 @@ TilesetJsonLoader::createLoader(
result.errors.emplaceError(fmt::format(
"Error when parsing tileset JSON, error code {} at byte offset "
"{}",
tilesetJson.GetParseError(),
static_cast<int32_t>(tilesetJson.GetParseError()),
tilesetJson.GetErrorOffset()));
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ BingMapsRasterOverlay::createTileProvider(
fmt::format(
"Error while parsing Bing Maps imagery metadata, error code "
"{} at byte offset {}",
response.GetParseError(),
static_cast<int32_t>(response.GetParseError()),
response.GetErrorOffset())});
}

Expand Down
2 changes: 1 addition & 1 deletion CesiumRasterOverlays/src/IonRasterOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ IonRasterOverlay::createTileProvider(
fmt::format(
"Error while parsing Cesium ion raster overlay response, "
"error code {} at byte offset {}",
response.GetParseError(),
static_cast<int32_t>(response.GetParseError()),
response.GetErrorOffset())});
}

Expand Down

0 comments on commit 3856537

Please sign in to comment.