I like the intention behind @ohadlevy's suggestion, but I'd try to make the `match()[1]` a bit more robust.  If the error message in AR changed for some reason in later versions and didn't match the regexp, this could fail and we wouldn't notice for some time.  Maybe use an inline 'rescue' so at least we don't break this error path for a trivial reason.