Skip to content

Commit da3b479

Browse files
committed
rename InternalExceptionto RuntimeException
1 parent 2d8b6a7 commit da3b479

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

kscr-core/Bytecode/Property.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public Stack WriteValue(RuntimeBase vm, Stack stack, IObject to)
6565

6666
if (WriteAccessor != null)
6767
return WriteAccessor.Evaluate(vm, stack);
68-
throw new InternalException("Property " + FullName + " is not settable");
68+
throw new RuntimeException("Property " + FullName + " is not settable");
6969
}
7070

7171
public IEvaluable? ReadAccessor

kscr-core/Bytecode/Statement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Stack Evaluate(RuntimeBase vm, Stack stack)
112112
break;
113113
}
114114
}
115-
catch (InternalException codeEx)
115+
catch (RuntimeException codeEx)
116116
{
117117
stack[Tau] = new ObjectRef(Class.ThrowableType.DefaultInstance, codeEx.Obj);
118118
CatchFinally?.Evaluate(vm, stack);
@@ -259,7 +259,7 @@ public virtual Stack Evaluate(RuntimeBase vm, Stack stack)
259259
var targetType = vm.FindType(Arg)!;
260260
var currentType = stack[Default]!.Value!.Type;
261261
if (!targetType.CanHold(currentType))
262-
throw new InternalException($"Cannot cast {currentType} to {targetType}");
262+
throw new RuntimeException($"Cannot cast {currentType} to {targetType}");
263263
// casting is implicitly evaluated by design
264264
break;
265265
case (StatementComponentType.Expression, BytecodeType.StmtIf):

kscr-core/Exception/FatalException.cs renamed to kscr-core/Exception/Exception.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55

66
namespace KScr.Core.Exception;
77

8-
public class InternalException : System.Exception
8+
public class RuntimeException : System.Exception
99
{
1010
internal readonly IObject Obj;
1111

12-
public InternalException(string? message, IObject? obj = null) : base(message)
12+
public RuntimeException(string? message, IObject? obj = null) : base(message)
1313
{
1414
Obj = obj ?? IObject.Null;
1515
}
1616

17-
public InternalException(string? message, System.Exception? innerException) : base(
17+
public RuntimeException(string? message, System.Exception? innerException) : base(
1818
message ?? innerException?.Message, innerException)
1919
{
2020
Obj = IObject.Null;
@@ -46,7 +46,7 @@ public interface IStackTrace
4646

4747
public class StackTraceException : System.Exception, IStackTrace
4848
{
49-
public StackTraceException(CallLocation srcPos, string local, InternalException innerCause,
49+
public StackTraceException(CallLocation srcPos, string local, RuntimeException innerCause,
5050
string? message = null)
5151
: base(message ?? "<...>", innerCause)
5252
{
@@ -64,7 +64,7 @@ public StackTraceException(CallLocation srcPos, string local, StackTraceExceptio
6464
InnerCause = innerTrace.InnerCause;
6565
}
6666

67-
public InternalException InnerCause { get; }
67+
public RuntimeException InnerCause { get; }
6868
public string Local { get; }
6969
public string BaseMessage => base.Message;
7070
public CallLocation CallLoc { get; }

kscr-core/Store/Stack.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private void WrapExecution(RuntimeBase vm, Action<Stack> exec, StackOutput maint
283283
// ReSharper disable once PossibleIntendedRethrow
284284
throw ex;
285285
}
286-
catch (InternalException ex)
286+
catch (RuntimeException ex)
287287
{
288288
//if (RuntimeBase.DebugMode)
289289
// ReSharper disable once PossibleIntendedRethrow
@@ -313,7 +313,7 @@ private void WrapExecution(RuntimeBase vm, Action<Stack> exec, StackOutput maint
313313
if (Omg == null || /* null check */ Omg.Value.ObjectId == 0)
314314
{
315315
RuntimeBase.ExitCode = -1;
316-
throw new InternalException("No Message Provided", IObject.Null);
316+
throw new RuntimeException("No Message Provided", IObject.Null);
317317
}
318318

319319
if (!Std.Class.ThrowableType.CanHold(Omg.Value.Type)
@@ -327,7 +327,7 @@ private void WrapExecution(RuntimeBase vm, Action<Stack> exec, StackOutput maint
327327
RuntimeBase.ExitMessage =
328328
throwable.InvokeNative(vm, Output(), "Message").Copy(output: StackOutput.Bet)![vm, this, 0]
329329
.ToString(0);
330-
throw new InternalException(
330+
throw new RuntimeException(
331331
$"{throwable.Type.Name}: {RuntimeBase.ExitMessage} ({RuntimeBase.ExitCode})", Omg.Value);
332332
}
333333

kscr-core/kscr-core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</PropertyGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="System.IO.Compression" Version="4.3.0"/>
29+
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
3030
</ItemGroup>
3131

3232
</Project>

0 commit comments

Comments
 (0)