Skip to content
Snippets Groups Projects
Commit 656b9369 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

Add name, value info to convert_from_llsd<> specialization LL_ERRS.

Prior to this, you could get a viewer crash whose ERROR: message said only:
convert_from_llsd<std::string>: Invalid string value
This gave no hint as to *which value* was wrong, or where to go fix it.
Ironically, each convert_from_llsd<> specialization already has the
control_name and LLSD value in hand; added these to each such LL_ERRS message.
parent 5da253fd
No related branches found
No related tags found
No related merge requests found
...@@ -1107,7 +1107,7 @@ bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::strin ...@@ -1107,7 +1107,7 @@ bool convert_from_llsd<bool>(const LLSD& sd, eControlType type, const std::strin
return sd.asBoolean(); return sd.asBoolean();
else else
{ {
CONTROL_ERRS << "Invalid BOOL value" << llendl; CONTROL_ERRS << "Invalid BOOL value for " << control_name << ": " << sd << llendl;
return FALSE; return FALSE;
} }
} }
...@@ -1119,7 +1119,7 @@ S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string& ...@@ -1119,7 +1119,7 @@ S32 convert_from_llsd<S32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger(); return sd.asInteger();
else else
{ {
CONTROL_ERRS << "Invalid S32 value" << llendl; CONTROL_ERRS << "Invalid S32 value for " << control_name << ": " << sd << llendl;
return 0; return 0;
} }
} }
...@@ -1131,7 +1131,7 @@ U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string& ...@@ -1131,7 +1131,7 @@ U32 convert_from_llsd<U32>(const LLSD& sd, eControlType type, const std::string&
return sd.asInteger(); return sd.asInteger();
else else
{ {
CONTROL_ERRS << "Invalid U32 value" << llendl; CONTROL_ERRS << "Invalid U32 value for " << control_name << ": " << sd << llendl;
return 0; return 0;
} }
} }
...@@ -1143,7 +1143,7 @@ F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string& ...@@ -1143,7 +1143,7 @@ F32 convert_from_llsd<F32>(const LLSD& sd, eControlType type, const std::string&
return (F32) sd.asReal(); return (F32) sd.asReal();
else else
{ {
CONTROL_ERRS << "Invalid F32 value" << llendl; CONTROL_ERRS << "Invalid F32 value for " << control_name << ": " << sd << llendl;
return 0.0f; return 0.0f;
} }
} }
...@@ -1155,7 +1155,7 @@ std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, co ...@@ -1155,7 +1155,7 @@ std::string convert_from_llsd<std::string>(const LLSD& sd, eControlType type, co
return sd.asString(); return sd.asString();
else else
{ {
CONTROL_ERRS << "Invalid string value" << llendl; CONTROL_ERRS << "Invalid string value for " << control_name << ": " << sd << llendl;
return LLStringUtil::null; return LLStringUtil::null;
} }
} }
...@@ -1173,7 +1173,7 @@ LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const ...@@ -1173,7 +1173,7 @@ LLVector3 convert_from_llsd<LLVector3>(const LLSD& sd, eControlType type, const
return (LLVector3)sd; return (LLVector3)sd;
else else
{ {
CONTROL_ERRS << "Invalid LLVector3 value" << llendl; CONTROL_ERRS << "Invalid LLVector3 value for " << control_name << ": " << sd << llendl;
return LLVector3::zero; return LLVector3::zero;
} }
} }
...@@ -1185,7 +1185,7 @@ LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, cons ...@@ -1185,7 +1185,7 @@ LLVector3d convert_from_llsd<LLVector3d>(const LLSD& sd, eControlType type, cons
return (LLVector3d)sd; return (LLVector3d)sd;
else else
{ {
CONTROL_ERRS << "Invalid LLVector3d value" << llendl; CONTROL_ERRS << "Invalid LLVector3d value for " << control_name << ": " << sd << llendl;
return LLVector3d::zero; return LLVector3d::zero;
} }
} }
...@@ -1197,7 +1197,7 @@ LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::s ...@@ -1197,7 +1197,7 @@ LLRect convert_from_llsd<LLRect>(const LLSD& sd, eControlType type, const std::s
return LLRect(sd); return LLRect(sd);
else else
{ {
CONTROL_ERRS << "Invalid rect value" << llendl; CONTROL_ERRS << "Invalid rect value for " << control_name << ": " << sd << llendl;
return LLRect::null; return LLRect::null;
} }
} }
...@@ -1211,19 +1211,19 @@ LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const st ...@@ -1211,19 +1211,19 @@ LLColor4 convert_from_llsd<LLColor4>(const LLSD& sd, eControlType type, const st
LLColor4 color(sd); LLColor4 color(sd);
if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f) if (color.mV[VRED] < 0.f || color.mV[VRED] > 1.f)
{ {
llwarns << "Color " << control_name << " value out of range " << llendl; llwarns << "Color " << control_name << " red value out of range: " << color << llendl;
} }
else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f) else if (color.mV[VGREEN] < 0.f || color.mV[VGREEN] > 1.f)
{ {
llwarns << "Color " << control_name << " value out of range " << llendl; llwarns << "Color " << control_name << " green value out of range: " << color << llendl;
} }
else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f) else if (color.mV[VBLUE] < 0.f || color.mV[VBLUE] > 1.f)
{ {
llwarns << "Color " << control_name << " value out of range " << llendl; llwarns << "Color " << control_name << " blue value out of range: " << color << llendl;
} }
else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f) else if (color.mV[VALPHA] < 0.f || color.mV[VALPHA] > 1.f)
{ {
llwarns << "Color " << control_name << " value out of range " << llendl; llwarns << "Color " << control_name << " alpha value out of range: " << color << llendl;
} }
return LLColor4(sd); return LLColor4(sd);
...@@ -1242,7 +1242,7 @@ LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const st ...@@ -1242,7 +1242,7 @@ LLColor3 convert_from_llsd<LLColor3>(const LLSD& sd, eControlType type, const st
return sd; return sd;
else else
{ {
CONTROL_ERRS << "Invalid LLColor3 value" << llendl; CONTROL_ERRS << "Invalid LLColor3 value for " << control_name << ": " << sd << llendl;
return LLColor3::white; return LLColor3::white;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment