//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

/// <summary>
/// ESystemError exception creator (helper class)
/// </summary>
public static class e_system_error {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static ESystemError New( u.SystemErrorKind errorKind,
                                string messageFmt, params object?[] args ) =>
   new ESystemError( errorKind, messageFmt.FMT( args ) );

public static ESystemError New( UInt64 errorCode64,
                                string messageFmt, params object?[] args ) =>
   new ESystemError( errorCode64, messageFmt.FMT( args ) );

public static ESystemError New( u.SystemErrorKind errorKind, UInt64 errorCode64,
                                string messageFmt, params object?[] args ) =>
   new ESystemError( errorKind, errorCode64, messageFmt.FMT( args ) );

//--------------------------------------------------------------------------------------------------

public static ESystemError New( u.SystemErrorKind errorKind, Exception error ) =>
   new ESystemError( errorKind, error.EM() );

public static ESystemError New( UInt64 errorCode64, Exception error ) =>
   new ESystemError( errorCode64, error.EM() );

public static ESystemError New( u.SystemErrorKind errorKind, UInt64 errorCode64,
                                Exception error ) =>
   new ESystemError( errorKind, errorCode64, error.EM() );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // e_system_error

} // user_rtx (.wasm)
