update error messaging, remove unnecessary comments
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -333,7 +333,12 @@ namespace AZ
|
||||
|
||||
// validate class name
|
||||
auto classData = loadSettings.m_serializeContext->FindClassData(classId);
|
||||
if (!classData || azstricmp(classData->m_name, className) != 0)
|
||||
if (!classData)
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Try to load class from Id %s", classId.ToString<AZStd::string>().c_str()));
|
||||
}
|
||||
|
||||
if (azstricmp(classData->m_name, className) != 0)
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Try to load class %s from class %s data", classData->m_name, className));
|
||||
}
|
||||
|
||||
@@ -114,13 +114,13 @@ namespace ScriptCanvasEditor
|
||||
|
||||
ScriptCanvas::ScriptCanvasData& ScriptCanvasAsset::GetScriptCanvasData()
|
||||
{
|
||||
AZ_Assert(m_data != nullptr, "data not initialized");
|
||||
AZ_Assert(m_data != nullptr, "ScriptCanvasData not initialized, it must be created on construction");
|
||||
return *m_data;
|
||||
}
|
||||
|
||||
const ScriptCanvas::ScriptCanvasData& ScriptCanvasAsset::GetScriptCanvasData() const
|
||||
{
|
||||
AZ_Assert(m_data != nullptr, "data not initialized");
|
||||
AZ_Assert(m_data != nullptr, "ScriptCanvasData not initialized, it must be created on construction");
|
||||
return *m_data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,6 @@ namespace ScriptCanvasEditor
|
||||
{
|
||||
byteStreamSource.Seek(0U, AZ::IO::GenericStream::ST_SEEK_BEGIN);
|
||||
AZ::JsonDeserializerSettings settings;
|
||||
// \todo more mapping stuff needs to go in the settings
|
||||
settings.m_serializeContext = m_serializeContext;
|
||||
// attempt JSON deserialization...
|
||||
if (JSRU::LoadObjectFromStreamByType
|
||||
@@ -139,7 +138,10 @@ namespace ScriptCanvasEditor
|
||||
return SaveAssetData(assetData, stream, AZ::DataStream::ST_XML);
|
||||
}
|
||||
|
||||
bool ScriptCanvasAssetHandler::SaveAssetData(const ScriptCanvasAsset* assetData, AZ::IO::GenericStream* stream, [[maybe_unused]] AZ::DataStream::StreamType streamType)
|
||||
bool ScriptCanvasAssetHandler::SaveAssetData
|
||||
( const ScriptCanvasAsset* assetData
|
||||
, AZ::IO::GenericStream* stream
|
||||
, [[maybe_unused]] AZ::DataStream::StreamType streamType)
|
||||
{
|
||||
namespace JSRU = AZ::JsonSerializationUtils;
|
||||
using namespace ScriptCanvas;
|
||||
@@ -153,6 +155,8 @@ namespace ScriptCanvasEditor
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Error("ScriptCanvas", false, "Saving ScriptCavas assets in the handler requires a valid IO stream, "
|
||||
"asset pointer, and serialize context");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +181,8 @@ namespace ScriptCanvasEditor
|
||||
EBUS_EVENT_RESULT(m_serializeContext, AZ::ComponentApplicationBus, GetSerializeContext);
|
||||
if (!m_serializeContext)
|
||||
{
|
||||
AZ_Error("Script Canvas", false, "ScriptCanvasAssetHandler: No serialize context provided! We will not be able to process Graph Asset type");
|
||||
AZ_Error("Script Canvas", false, "ScriptCanvasAssetHandler: No serialize context provided! "
|
||||
"We will not be able to process Graph Asset type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,7 +610,6 @@ namespace ScriptCanvas
|
||||
CreateHandler(m_ebusName);
|
||||
}
|
||||
|
||||
/// \note Call super() anti-pattern https://en.wikipedia.org/wiki/Call_super
|
||||
Node::OnDeserialize();
|
||||
}
|
||||
|
||||
|
||||
@@ -767,7 +767,6 @@ namespace ScriptCanvas
|
||||
m_resultSlotIDs.emplace_back(SlotId{});
|
||||
}
|
||||
|
||||
/// \note Call super() anti-pattern https://en.wikipedia.org/wiki/Call_super
|
||||
Node::OnDeserialize();
|
||||
}
|
||||
|
||||
|
||||
@@ -462,8 +462,6 @@ namespace ScriptCanvas
|
||||
}
|
||||
|
||||
SetWarnOnMissingFunction(true);
|
||||
|
||||
/// \note Call super() anti-pattern https://en.wikipedia.org/wiki/Call_super
|
||||
Node::OnDeserialize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user