DataTables.Queryable
DataTables.Queryable copied to clipboard
I really need to know what name/data failed when calling GetPropertyByName.
https://github.com/AlexanderKrutov/DataTables.Queryable/blob/master/DataTables.Queryable/DataTablesRequest.cs#L183
This might be a good argument for a custom exception (GetPropertyByStringException?), or pass the name to ArgumentException.
I am try/catching the instantiation of DataTablesRequest so I can gracefully handle any invalid column configurations instead of my server blowing up with a 500 error. I think other people will want to do this too.
As it stands right now, I am unable to identify and report the "bad" column type.
Usage
// ...
throw new DataTablesGetPropertyByStringException(type, name);
// Later in a catch(DataTablesGetPropertyByStringException ex) ...
return BadRequest($"Sorry, the property {ex.name} did not exist on {ex.type}");
Agree with custom exception type.