bartfeenstra / fu-php

🛠 Functional programming tools for PHP 🐘
https://twitter.com/BartFeenstra
MIT License
2 stars 1 forks source link

Add a version of *try_except() that converts and rethrows exceptions #63

Open bartfeenstra opened 7 years ago

bartfeenstra commented 7 years ago

When integrating APIs, it is often necessary to convert exceptions from the types of the called API to the types of the calling API, so they can bubble up again. This can be a pain, so let's consider introducing a new function to make this easy, with sensible and quick defaults, but the ability to invoke complex custom mapping behavior as well.