Skip to content
  • Veerpal Brar's avatar
    0f259e70
    Raise error when serializing an anonymous class. · 0f259e70
    Veerpal Brar authored
    The ModuleSerializer does not support serializing anonymous classes
    because when we try to deserialize the anonymous class, it wouldn't
    know which class to use (since class name is nil).
    
    For this reason, ModuleSerialzier now raises an error if the class
    name is nil. Previously, ModuleSerializer would raise an `undefined
    method `constantize' for nil:NilClass` error during deserialization.
    It's not clear why the deserialization failed from the error.
    
    In this commit, we raise an explicit error when trying to serialize
    an anonymous class indicating this behaviour is not supported.
    0f259e70
    Raise error when serializing an anonymous class.
    Veerpal Brar authored
    The ModuleSerializer does not support serializing anonymous classes
    because when we try to deserialize the anonymous class, it wouldn't
    know which class to use (since class name is nil).
    
    For this reason, ModuleSerialzier now raises an error if the class
    name is nil. Previously, ModuleSerializer would raise an `undefined
    method `constantize' for nil:NilClass` error during deserialization.
    It's not clear why the deserialization failed from the error.
    
    In this commit, we raise an explicit error when trying to serialize
    an anonymous class indicating this behaviour is not supported.
Loading