Ticket #408: use-pserror-stream.patch
File use-pserror-stream.patch, 1.6 KB (added by , 11 years ago) |
---|
-
trunk/source/simulation2/serialization/BinarySerializer.cpp
a b 50 50 case js::TypedArray::TYPE_UINT8_CLAMPED: 51 51 return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED; 52 52 default: 53 LOGERROR(L"Cannot serialize unrecognized typed array view: %d", arrayType); 54 throw PSERROR_Serialize_InvalidScriptValue(); 53 throw PSERROR_Serialize_InvalidScriptValue("Cannot serialize unrecognized typed array view: ") << arrayType; 55 54 } 56 55 } 57 56 … … 230 229 else 231 230 { 232 231 // Unrecognized class 233 LOGERROR(L"Cannot serialise JS objects with unrecognized class '%hs'", jsclass->name); 234 throw PSERROR_Serialize_InvalidScriptValue(); 232 throw PSERROR_Serialize_InvalidScriptValue("Cannot serialise JS objects with unrecognized class '") << jsclass->name << "'"; 235 233 } 236 234 } 237 235 … … 288 286 } 289 287 } 290 288 291 LOGERROR(L"Cannot serialise JS objects of type 'function': %ls", funcname.c_str()); 292 throw PSERROR_Serialize_InvalidScriptValue(); 289 throw PSERROR_Serialize_InvalidScriptValue("Cannot serialise JS objects of type 'function': ") << funcname; 293 290 } 294 291 case JSTYPE_STRING: 295 292 { … … 335 332 } 336 333 case JSTYPE_XML: 337 334 { 338 LOGERROR(L"Cannot serialise JS objects of type 'xml'"); 339 throw PSERROR_Serialize_InvalidScriptValue(); 335 throw PSERROR_Serialize_InvalidScriptValue("Cannot serialise JS objects of type 'xml'"); 340 336 } 341 337 default: 342 338 { 343 debug_warn(L"Invalid TypeOfValue"); 344 throw PSERROR_Serialize_InvalidScriptValue(); 339 throw PSERROR_Serialize_InvalidScriptValue("Invalid TypeOfValue"); 345 340 } 346 341 } 347 342 }