Skip to content

Commit 437d48b

Browse files
Update AppendDBMethod.cs
1 parent d63560f commit 437d48b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

MethodSystem/Methods/DatabaseMethods/AppendDBMethod.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,21 @@ public class AppendDBMethod : SynchronousMethod, ICanError
2020
new DatabaseArgument("database"),
2121
new TextArgument("key"),
2222
new AnyValueArgument("value")
23+
{
24+
Description = "For now only literal values and player values are supported."
25+
}
2326
];
2427

2528
public override void Execute()
2629
{
27-
if (Args.GetDatabase("database").Set(
28-
Args.GetText("key"),
30+
var res = Args.GetDatabase("database").TrySet(
31+
Args.GetText("key"),
2932
Args.GetAnyValue("value")
30-
).HasErrored(out var error))
33+
);
34+
35+
if (res.HasErrored(out var error))
36+
{
3137
throw new ScriptRuntimeError(error);
38+
}
3239
}
3340
}

0 commit comments

Comments
 (0)