-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial world.Error() implementation (#1598)
Co-authored-by: ike709 <[email protected]> Co-authored-by: wixoa <[email protected]>
- Loading branch information
1 parent
1c11807
commit cb33370
Showing
5 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace OpenDreamRuntime.Objects.Types; | ||
|
||
public sealed class DreamObjectException(DreamObjectDefinition objectDefinition) : DreamObject(objectDefinition) { | ||
public string Name = string.Empty; | ||
public string Description = string.Empty; | ||
public string File = 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 | ||
|
||
protected override bool TryGetVar(string varName, out DreamValue value) { | ||
switch (varName) { | ||
case "name": | ||
value = new DreamValue(Name); | ||
return true; | ||
case "desc": | ||
value = new DreamValue(Description); | ||
return true; | ||
case "file": | ||
value = new DreamValue(File); | ||
return true; | ||
case "line": | ||
value = new DreamValue(Line); | ||
return true; | ||
default: | ||
return base.TryGetVar(varName, out value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters