Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Jan 22, 2024
1 parent fc93123 commit 6349976
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OpenDreamRuntime/DreamManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public DreamValue LocateRef(string refString) {
return DreamValue.Null;
}

public void HandleException(Exception e, string msg = "", string file = "", string line = "") {
public void HandleException(Exception e, string msg = "", string file = "", int line = 0) {
if (string.IsNullOrEmpty(msg)) { // Just print the C# exception if we don't override the message
msg = e.Message;
}
Expand Down
4 changes: 2 additions & 2 deletions OpenDreamRuntime/DreamThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,13 @@ public void HandleException(Exception exception) {

// Instantiate an /exception and invoke world.Error()
string file = string.Empty;
int? line = null;
int line = 0;
if(_current is DMProcState dmProc) { // TODO: Cope with the other ProcStates
var source = dmProc.GetExceptionSource();

Check failure on line 392 in OpenDreamRuntime/DreamThread.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DMProcState' does not contain a definition for 'GetExceptionSource' and no accessible extension method 'GetExceptionSource' accepting a first argument of type 'DMProcState' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 392 in OpenDreamRuntime/DreamThread.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DMProcState' does not contain a definition for 'GetExceptionSource' and no accessible extension method 'GetExceptionSource' accepting a first argument of type 'DMProcState' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 392 in OpenDreamRuntime/DreamThread.cs

View workflow job for this annotation

GitHub Actions / build

'DMProcState' does not contain a definition for 'GetExceptionSource' and no accessible extension method 'GetExceptionSource' accepting a first argument of type 'DMProcState' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 392 in OpenDreamRuntime/DreamThread.cs

View workflow job for this annotation

GitHub Actions / build

'DMProcState' does not contain a definition for 'GetExceptionSource' and no accessible extension method 'GetExceptionSource' accepting a first argument of type 'DMProcState' could be found (are you missing a using directive or an assembly reference?)
file = source.Item1;
line = source.Item2;
}
dreamMan.HandleException(exception, msg, file, line?.ToString() ?? string.Empty);
dreamMan.HandleException(exception, msg, file, line);

IoCManager.Resolve<IDreamDebugManager>().HandleException(this, exception);
}
Expand Down
2 changes: 1 addition & 1 deletion OpenDreamRuntime/Objects/Types/DreamObjectException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public sealed class DreamObjectException(DreamObjectDefinition objectDefinition)
public string Name = string.Empty;
public string Description = string.Empty;
public string File = string.Empty;
public string Line = string.Empty;
public int Line = 0;

//TODO: Match the format of BYOND exceptions since SS13 does splittext and other things to extract data from exceptions

Expand Down
2 changes: 1 addition & 1 deletion OpenDreamRuntime/Procs/DMProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public override void AppendStackFrame(StringBuilder builder) {
builder.Append(Proc.GetSourceAtOffset(_pc - 1).Line);
}

public (string, int) GetExceptionSource() {
public (string, int) GetCurrentSource() {
return Proc.GetSourceAtOffset(_pc - 1);
}

Expand Down

0 comments on commit 6349976

Please sign in to comment.