Skip to content

Commit

Permalink
fix(readers): throw asyncapiexception, as this is handled by the main…
Browse files Browse the repository at this point in the history
… reader. (#80)
  • Loading branch information
VisualBean authored Nov 28, 2022
1 parent 05155d3 commit ef428b1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LEGO.AsyncAPI.Readers
{
using LEGO.AsyncAPI.Exceptions;
using LEGO.AsyncAPI.Models;
using LEGO.AsyncAPI.Models.Bindings;
using LEGO.AsyncAPI.Models.Interfaces;
Expand Down Expand Up @@ -45,7 +46,7 @@ internal static IChannelBinding LoadChannelBinding(ParseNode node)
case BindingType.Websockets:
return LoadBinding("ChannelBinding", property.Value, webSocketsChannelBindingFixedFields);
default:
throw new System.Exception("ChannelBinding not found");
throw new AsyncApiException($"ChannelBinding {property.Name} is not supported");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LEGO.AsyncAPI.Readers
{
using LEGO.AsyncAPI.Exceptions;
using LEGO.AsyncAPI.Extensions;
using LEGO.AsyncAPI.Models;
using LEGO.AsyncAPI.Models.Bindings;
Expand Down Expand Up @@ -48,7 +49,7 @@ internal static IMessageBinding LoadMessageBinding(ParseNode node)
case BindingType.Http:
return LoadBinding<HttpMessageBinding>("MessageBinding", property.Value, httpMessageBindingFixedFields);
default:
throw new System.Exception("MessageBinding not found");
throw new AsyncApiException($"MessageBinding {property.Name} is not supported");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LEGO.AsyncAPI.Readers
{
using LEGO.AsyncAPI.Exceptions;
using LEGO.AsyncAPI.Models;
using LEGO.AsyncAPI.Models.Bindings;
using LEGO.AsyncAPI.Models.Interfaces;
Expand Down Expand Up @@ -45,7 +46,7 @@ internal static IOperationBinding LoadOperationBinding(ParseNode node)
case BindingType.Http:
return LoadBinding("OperationBinding", property.Value, httpOperationBindingFixedFields);
default:
throw new System.Exception("OperationBinding not found");
throw new AsyncApiException($"OperationBinding {property.Name} is not supported");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LEGO.AsyncAPI.Readers
{
using LEGO.AsyncAPI.Exceptions;
using LEGO.AsyncAPI.Models;
using LEGO.AsyncAPI.Models.Bindings;
using LEGO.AsyncAPI.Models.Interfaces;
Expand Down Expand Up @@ -43,7 +44,7 @@ internal static IServerBinding LoadServerBinding(ParseNode node)
case BindingType.Kafka:
return LoadBinding("ServerBinding", property.Value, kafkaServerBindingFixedFields);
default:
throw new System.Exception("ServerBinding not found");
throw new AsyncApiException($"ServerBinding {property.Name} is not supported");
}
}
}
Expand Down

0 comments on commit ef428b1

Please sign in to comment.