Error handling in NativeStream