Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecuteAsync has an exception occur when an arg is missing. #726

Closed
natekford opened this issue Jun 30, 2017 · 2 comments
Closed

ExecuteAsync has an exception occur when an arg is missing. #726

natekford opened this issue Jun 30, 2017 · 2 comments

Comments

@natekford
Copy link
Contributor

natekford commented Jun 30, 2017

Stacktrace:

System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector)
   at Discord.Commands.CommandService.<ExecuteAsync>g__CalculateScore41_7(CommandMatch match, ParseResult parseResult)
   at Discord.Commands.CommandService.<>c.<ExecuteAsync>b__41_12(KeyValuePair2 x)
   at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable1.<GetEnumerator>d__1.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
   at System.Linq.Buffer1..ctor(IEnumerable1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
   at Discord.Commands.CommandService.<ExecuteAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
   at Advobot.Command_Handler.<HandleCommand>d__4.MoveNext() in C:\Users\User\Documents\Visual Studio 2017\Projects\Advobot\Advobot\Advobot_Command_Handler.cs:line 51

Command:

public async Task Test(string input)
{
	await Actions.SendChannelMessage(Context, "test");
}

Input:

&&test

In the current 1.0.0 version ExecuteAsync produces an exception instead of only failing. In at least Discord.Net v1.0.0-rc3-00755 this would produce an IResult with IsSuccess = false and an Error/ErrorReason.

@Joe4evr
Copy link
Contributor

Joe4evr commented Jun 30, 2017

CalculateScore

#BlameFinite @FiniteReality

@FiniteReality
Copy link
Member

At least it knows your arg is missing 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants