diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_encode.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_encode.py index 9f7ad091d345e..c1112d9f6a14d 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_encode.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_encode.py @@ -776,7 +776,7 @@ def encode_filter_set(value): VALUE: ({TYPE: AMQPTypes.symbol, VALUE: descriptor}, filter_value), } # if its not a type that is known, raise the error from the server - except Exception: + except (ValueError, TypeError): described_filter = data cast(List, fields[VALUE]).append( diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_encode.py b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_encode.py index 9f7ad091d345e..c1112d9f6a14d 100644 --- a/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_encode.py +++ b/sdk/servicebus/azure-servicebus/azure/servicebus/_pyamqp/_encode.py @@ -776,7 +776,7 @@ def encode_filter_set(value): VALUE: ({TYPE: AMQPTypes.symbol, VALUE: descriptor}, filter_value), } # if its not a type that is known, raise the error from the server - except Exception: + except (ValueError, TypeError): described_filter = data cast(List, fields[VALUE]).append(