You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
If I do a bulk-load of many columns and many values, and then one of the values fail validation, the corresponding exception does not mention the concerned column name and neither the erroneous value. This makes it unnecessarily difficult to narrow down the wrong value that failed validation.
try {
value = c.type.validate(value, c.collation);
} catch (error: any) {
error.column = c.name
error.wrongValue = value
return callback(error);
}
Of course you are free to add this information to any other of the properties, or even append it to the message. The main point is that these two bits of information should be added to the exception in any form.
Describe alternatives you've considered
hm... the exception here is pretty much exactly the normal error handling. It is simply missing the information about the place where the exception occurred.
The text was updated successfully, but these errors were encountered:
@mShan0@MichaelSun90 Can you take this on? I think it would be best to create a new Error subclass (maybe called ParameterValidationError), have it inherit from whatever error class we currently use (that might be TypeError, but I'm not sure), and define the additional properties on that.
Is your feature request related to a problem? If so, please give a short summary of the problem and how the feature would resolve it
If I do a bulk-load of many columns and many values, and then one of the values fail validation, the corresponding exception does not mention the concerned column name and neither the erroneous value. This makes it unnecessarily difficult to narrow down the wrong value that failed validation.
Describe the preferred solution
In https://github.com/tediousjs/tedious/blob/master/src/bulk-load.ts#L188 please add the
c.name
and also thevalue
to the exception object that is returned. For example by simply adding more properties:The section of the code would then read:
Of course you are free to add this information to any other of the properties, or even append it to the message. The main point is that these two bits of information should be added to the exception in any form.
Describe alternatives you've considered
hm... the exception here is pretty much exactly the normal error handling. It is simply missing the information about the place where the exception occurred.
The text was updated successfully, but these errors were encountered: