You should refactor this to use the `errorcallback` on line `1661` instead so we have the same error messages at least.  We have a much better message in there anyway and the logic is much simpler since the message is more generic.