// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Debug/Exception.h" #include "Engine/Serialization/Json.h" #include namespace Log { /// /// The exception that is thrown when parsing json file fails. /// class JsonParseException : public Exception { public: typedef rapidjson::ParseErrorCode ErrorCode; public: /// /// Init /// /// Parsing error code. /// Parsing error location. JsonParseException(ErrorCode error, size_t offset) : JsonParseException(error, offset, StringView::Empty) { } /// /// Creates default exception with additional data /// /// Parsing error code. /// Parsing error location. /// Additional information that help describe error JsonParseException(ErrorCode error, size_t offset, const StringView& additionalInfo) : Exception(String::Format(TEXT("Parsing Json failed with error code {0} (offset {2}). {1}"), static_cast(error), GetParseError_En(error), offset), additionalInfo) { } }; }