Skip to content

Commit 9a44deb

Browse files
[.NET] Temporary handling of "not found" schema registry error (#602)
1 parent 35af548 commit 9a44deb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dotnet/src/Azure.Iot.Operations.Services/SchemaRegistry/SchemaRegistryClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public class SchemaRegistryClient(ApplicationContext applicationContext, IMqttPu
3636
}
3737
}, null, null, timeout ?? s_DefaultCommandTimeout, cancellationToken)).Schema;
3838
}
39+
catch (AkriMqttException ex) when (ex.Kind == AkriMqttErrorKind.PayloadInvalid)
40+
{
41+
// This is likely because the user received a "not found" response payload from the service, but the service is an
42+
// older version that sends an empty payload instead of the expected "{}" payload.
43+
return null;
44+
}
3945
catch (AkriMqttException e) when (e.Kind == AkriMqttErrorKind.UnknownError)
4046
{
4147
// ADR 15 specifies that schema registry clients should still throw a distinct error when the service returns a 422. It also specifies

0 commit comments

Comments
 (0)