Skip to content

Exception message missing parameter name #33

Closed
@danmoseley

Description

@danmoseley

This message probably meant to have the parameter name in the string.

"System.ArgumentOutOfRangeException:  is missing ColumnAttribute
Parameter name: Name
   at Microsoft.ML.TextLoader`1.SetCustomStringFromType(Boolean useHeader, String separator, Boolean allowQuotedStrings, Boolean supportSparse, Boolean trimWhitespace)
   at Microsoft.ML.TextLoader`1..ctor(String inputFilePath, Boolean useHeader, String separator, Boolean allowQuotedStrings, Boolean supportSparse, Boolean trimWhitespace)
   at Microsoft.ML.NYCTaxiFare.Program.Train() in C:\Users\danmose\source\repos\ConsoleApp81\ConsoleApp81\Program.cs:line 25
   at Microsoft.ML.NYCTaxiFare.Program.Main(String[] args) in C:\Users\danmose\source\repos\ConsoleApp81\ConsoleApp81\Program.cs:line 17"

It's because it's thrown like
throw Contracts.ExceptParam(nameof(field.Name), " is missing ColumnAttribute");
and the ExceptParam does not prefix it for free:

  306:         public static Exception ExceptParam(string paramName, string msg)
  307              => Process(new ArgumentOutOfRangeException(paramName, msg));

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersup-for-grabsA good issue to fix if you are trying to contribute to the project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions