Fix error handling.
make sure we can send different types to logging