public ITypeSpecImmutable GetSpecification(Type type, bool allowNull = false) { try { var spec = GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type)); if (spec == null && !allowNull) { throw new NakedObjectSystemException(Log.LogAndReturn($"Failed to Load Specification for: {type?.FullName} error: unexpected null")); } return(spec); } catch (NakedObjectSystemException e) { Log.Error($"Failed to Load Specification for: {(type == null ? "null" : type.FullName)} error: {e}"); throw; } catch (Exception e) { throw new NakedObjectSystemException(Log.LogAndReturn($"Failed to Load Specification for: {type?.FullName} error: {e}")); } }
public ITypeSpecImmutable GetSpecification(Type type, bool allowNull = false) { try { var spec = GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type)); if (spec == null && !allowNull) { Log.ErrorFormat("Failed to Load Specification for: {0} error: {1}", type == null ? "null" : type.FullName, "unexpected null"); throw new NakedObjectSystemException(string.Format("failed to find spec for {0}", type == null ? "null" : type.FullName)); } return(spec); } catch (NakedObjectSystemException) { throw; } catch (Exception e) { Log.ErrorFormat("Failed to Load Specification for: {0} error: {1}", type == null ? "null" : type.FullName, e); throw new NakedObjectSystemException(string.Format("failed to find spec for {0}", type == null ? "null" : type.FullName)); } }
public IObjectSpecImmutable GetSpecification(Type type) { return(GetSpecificationFromCache(classStrategy.FilterNullableAndProxies(type))); }