[#239] Implement `containsKey` with exception handling

* Implement `containsKey` helper function with built-in exception
  handling