src/sys/dotnet/fan/sys/Err.cs
/// <summary>
/// Map a java exception to it's Fantom Err counter part.  Common runtime
/// exceptions are mapped into explicit Fantom types.  Otherwise we just
/// wrap the exception with a generic Err.
/// </summary>
Map a java exception to it's Fantom Err counter part.  Common runtime
exceptions are mapped into explicit Fantom types.  Otherwise we just
wrap the exception with a generic Err.
Map a java exception to it ' s Fantom Err counter part . Common runtime exceptions are mapped into explicit Fantom types . Otherwise we just wrap the exception with a generic Err .
public static Err make(Exception ex)
    {
      if (ex == null) return null;
      if (ex is Val)                         return ((Val)ex).m_err;
      if (ex is NullReferenceException)      return new NullErr(ex);
      if (ex is InvalidCastException)        return new CastErr(ex);
      if (ex is IndexOutOfRangeException)    return new IndexErr(ex);
      if (ex is ArgumentOutOfRangeException) return new IndexErr(ex);
      if (ex is ArgumentException)           return new ArgErr(ex);
      if (ex is IOException)                 return new IOErr(ex);
      if (ex is SocketException)             return new IOErr(ex); 
      if (ex is ThreadInterruptedException)  return new InterruptedErr(ex);
      if (ex is NotSupportedException)       return new UnsupportedErr(ex);
      return new Err(new Err.Val(), ex);
    }
public static Err make ( Exception ex ) { if ( ex == null ) return null ; if ( ex is Val ) return ( ( Val ) ex ) . m_err ; if ( ex is NullReferenceException ) return new NullErr ( ex ) ; if ( ex is InvalidCastException ) return new CastErr ( ex ) ; if ( ex is IndexOutOfRangeException ) return new IndexErr ( ex ) ; if ( ex is ArgumentOutOfRangeException ) return new IndexErr ( ex ) ; if ( ex is ArgumentException ) return new ArgErr ( ex ) ; if ( ex is IOException ) return new IOErr ( ex ) ; if ( ex is SocketException ) return new IOErr ( ex ) ; if ( ex is ThreadInterruptedException ) return new InterruptedErr ( ex ) ; if ( ex is NotSupportedException ) return new UnsupportedErr ( ex ) ; return new Err ( new Err . Val ( ) , ex ) ; }
Map a java exception to it's Fantom Err counter part.
Map a java exception to it ' s Fantom Err counter part .
// TODO?
ex
Exception