ForeignGenerator.cs property Key is not found if the generator tag is empty causes exception

Description

I have patched ForeignGenerator.cs on line 90 to use parm.TryGetValue for the property name. If the mapping file doesn't contain the property inside the generator tag, a vague KeyNotFound exception is thrown by Dictionary<string, string>.

The exception will also provide the table name, which should make it easier for the end use to locate the offending mapping file.

Environment

None

Attachments

1
  • 12 May 2008, 10:51 AM

Activity

Show:

Fabio Maulo June 16, 2008 at 9:14 AM

Patched the branch (in the trunk was already changed for others matters).

Jason Chartrand May 20, 2008 at 12:26 PM

TryGetValue will not throw an exception on line 90 if the key is not found, whereas the existing code will throw a KeyNotFound exception.

Dario Quintana May 14, 2008 at 6:41 AM

Ok, but you're using a TryGetValue, so there is a posibility to doesn't exists

Jason Chartrand May 12, 2008 at 8:42 PM

Wouldn't target table get picked up when the mapping document is first parsed? The issue in ForeignGenerator.cs doesn't get picked up until Configure().

Dario Quintana May 12, 2008 at 8:23 PM

What if the target_table parameter isn't set ? the error message won't be so nice.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created May 12, 2008 at 10:51 AM
Updated June 16, 2008 at 9:14 AM
Resolved June 16, 2008 at 9:14 AM
Who's Looking?