/// <param name="icon">Path to result icon.</param>
/// <param name="isGlobalQuery">Bool to indicate if it is a global query.</param>
/// <param name="queryInput">User input as string including the action keyword.</param>
/// <param name="errorMessage">Error message if applicable.</param>
/// <param name="exception">Exception if applicable.</param>
/// <returns>List of results to show. Either an error message or an empty list.</returns>
/// <exception cref="ArgumentException">Thrown if <paramref name="errorMessage"/> and <paramref name="exception"/> are both filled with their default values.</exception>
Log.Error($"Failed to calculate <{queryInput}>: {errorMessage}",typeof(Calculator.Main));
userMessage=errorMessage;
}
elseif(exception!=default)
{
Log.Exception($"Exception when query for <{queryInput}>",exception,exception.GetType());
userMessage=exception.Message;
}
else
{
thrownewArgumentException("The arguments error and exception have default values. One of them has to be filled with valid error data (error message/exception)!");