From 4a0d5ae43cb576786ea4a1efdf5e57ef926d99bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sun, 8 Jan 2023 19:33:50 +0100 Subject: [PATCH] chore: use specific errors instead of GenericError --- Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs | 4 ++-- .../Operations/WalkInRangeOperation.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs index 56b3320..83a5a4e 100644 --- a/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs +++ b/Core/NosSmooth.Game/Apis/NostaleSkillsPacketApi.cs @@ -176,7 +176,7 @@ public class NostaleSkillsPacketApi if (skill.Info is null) { - return Task.FromResult(new GenericError("Skill does not contain info.")); + return Task.FromResult(new NotInitializedError("skill info")); } return _client.SendPacketAsync @@ -224,7 +224,7 @@ public class NostaleSkillsPacketApi if (skill.Info is null) { - return Task.FromResult(new GenericError("Skill does not contain info.")); + return Task.FromResult(new NotInitializedError("skill info")); } return _client.SendPacketAsync diff --git a/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs b/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs index e579179..c0b37be 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Operations/WalkInRangeOperation.cs @@ -9,6 +9,7 @@ using NosSmooth.Extensions.Pathfinding; using NosSmooth.Extensions.Pathfinding.Errors; using NosSmooth.Game.Data.Entities; using NosSmooth.Game.Data.Info; +using NosSmooth.Game.Errors; using Remora.Results; namespace NosSmooth.Extensions.Combat.Operations; @@ -53,7 +54,7 @@ public record WalkInRangeOperation var position = Entity.Position; if (position is null) { - return new GenericError("Entity's position is not initialized."); + return new NotInitializedError("entity's position"); } var currentPosition = character.Position; -- 2.49.0