Anupam- / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

Optin on more detailed info on cast exception #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not a biggie just for the wish list, which would make debugging easier.

What steps will reproduce the problem?
  Have mapped type become invalid because changes in database or
  select. i.e. int becomes bigint. SQL Server can "upcast" implicity
  if someone wasn't thinking when creating a procedure i.e.

What is the expected output? What do you see instead?
  Now we just get an invalid cast exception, would be great if at
  least could optin to get an more detailed exception (field name,
  field type expected type) or perhaps have an option to have an
  InvalidCast callback which gets called with the reader/command
  before the exceptions is re thrown and the end user handles
  detailed logging.

What version of the product are you using? On what operating system?
  changeset:   60:bda6f2c8327a

Please provide any additional information below.
  Sample of implicit casting
  SELECT    1 AS First,
        2147483648 AS Second,
        ISNULL(@long, 1) AS Third

  will result in:
   First    int
   Second   numeric
   Third    bigint

Original issue reported on code.google.com by mattias%...@gtempaccount.com on 28 Apr 2011 at 9:33

GoogleCodeExporter commented 9 years ago
yeah agree, we might be able to resolve this and provide a nice exception 
without any perf implications, so it would not have to be a switch 

Original comment by sam.saff...@gmail.com on 29 Apr 2011 at 1:06

GoogleCodeExporter commented 9 years ago
Much more detail is now available when something goes ping

Original comment by marc.gravell on 3 May 2011 at 9:41