Looks like things would be simpler if we removed the `while` loop and instead wrote something like:
```
var error = _(errorMaps).where({ fromFunction: functionName, fromId: errorCode });
```