Skip to content

How to handle exceptions? #7

@Coke21

Description

@Coke21

Hi, I'm trying to use your library instead of QueryMaster. I cannot get my head around handling exceptions if the server is e.g. offline. The following code:

IServerQuery serverQuery = new ServerQuery($"{serverModel.ServerIp}:{serverModel.ServerQueryPort}");
ServerInfo info = await serverQuery.GetServerInfoAsync();

If the server is offline it will get "stuck" on ServerInfo info = await serverQuery.GetServerInfoAsync(); and wait infinitely? at this line of code. With QueryMaster, it just returned null so I could see that the server is offline. How can I handle this with your library? Thanks for help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions