Is someone know how to catch an error from stream api(python)

is someone know how to catch an error from stream api(python)