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

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

/// <summary>
/// Platform errors (exception creation)
/// </summary>
public static class platform_errors {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/// <exception cref="ArgumentException" />
public static PlatformNotSupportedException NOT_SUPPORTED( string methodFullName ) =>
   new PlatformNotSupportedException(u.str.FMT(
      "Operation is not supported on this platform.\n"+
      "({0})", u.str_argcheck.NE( methodFullName, nameof(methodFullName) )));

/// <exception cref="ArgumentException" />
public static PlatformNotSupportedException NOT_SUPPORTED( Type objectType, string methodName ) =>
   NOT_SUPPORTED( u.code_fmt.MemberName( objectType, methodName ) );
/// <exception cref="ArgumentException" />
public static PlatformNotSupportedException NOT_SUPPORTED_Auto( Type objectType,
                                                                [CallerMemberName]
                                                                string methodName="" ) =>
   NOT_SUPPORTED( objectType, methodName );

public static PlatformNotSupportedException NOT_SUPPORTED( MethodBase method ) =>
   NOT_SUPPORTED( u.code_fmt.MethodName( method ) );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // platform_errors

} // user_rtx (.wasm)
