Ticket #408: use-pserror-stream.patch

File use-pserror-stream.patch, 1.6 KB (added by Markus, 11 years ago)
  • trunk/source/simulation2/serialization/BinarySerializer.cpp

    a b  
    5050    case js::TypedArray::TYPE_UINT8_CLAMPED:
    5151        return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED;
    5252    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;
    5554    }
    5655}
    5756
     
    230229            else
    231230            {
    232231                // 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 << "'";
    235233            }
    236234        }
    237235
     
    288286            }
    289287        }
    290288
    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;
    293290    }
    294291    case JSTYPE_STRING:
    295292    {
     
    335332    }
    336333    case JSTYPE_XML:
    337334    {
    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'");
    340336    }
    341337    default:
    342338    {
    343         debug_warn(L"Invalid TypeOfValue");
    344         throw PSERROR_Serialize_InvalidScriptValue();
     339        throw PSERROR_Serialize_InvalidScriptValue("Invalid TypeOfValue");
    345340    }
    346341    }
    347342}