From ed589508b212a69b94d480c00932860156911019 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 30 Nov 2022 19:09:24 +0000 Subject: [PATCH] Add NotInWorldException --- VpSharp/src/Exceptions/NotInWorldException.cs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 VpSharp/src/Exceptions/NotInWorldException.cs diff --git a/VpSharp/src/Exceptions/NotInWorldException.cs b/VpSharp/src/Exceptions/NotInWorldException.cs new file mode 100644 index 0000000..e9073b0 --- /dev/null +++ b/VpSharp/src/Exceptions/NotInWorldException.cs @@ -0,0 +1,40 @@ +using VpSharp.Internal; + +namespace VpSharp.Exceptions; + +/// +/// The exception that is thrown when an operation was attempted that requires a connection to a world, but the instance is +/// not currently connected to one. +/// +public sealed class NotInWorldException : VirtualParadiseException +{ + /// + /// Initializes a new instance of the class. + /// + public NotInWorldException() + : base(ReasonCode.NotInWorld) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message that describes the error. + public NotInWorldException(string message) + : base(ReasonCode.NotInWorld, message) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message that describes the error. + /// + /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner + /// exception is specified. + /// + public NotInWorldException(string message, Exception innerException) + : base(ReasonCode.NotInWorld, message, innerException) + { + } +}