Skip to content

Conversation

@GarrettBeatty
Copy link
Contributor

@GarrettBeatty GarrettBeatty commented Mar 6, 2025

Issue #, if available: DOTNET-7438

Description of changes:

  1. Update error message when subscriber mapping is null.
  2. I was trying to reproduce the other bugs mentioned in above ticket, but was not able to, so I am just updating the error message for now

Example error message

{
  "errorType": "FailedToCreateMessageEnvelopeException",
  "errorMessage": "Failed to create MessageEnvelope",
  "stackTrace": [
    "at AWS.Messaging.Serialization.EnvelopeSerializer.ConvertToEnvelopeAsync(Message sqsMessage) in C:\\dev\\repos\\aws-dotnet-messaging\\src\\AWS.Messaging\\Serialization\\EnvelopeSerializer.cs:line 192",
    "at AWS.Messaging.Lambda.Services.DefaultLambdaMessageProcessor.ProcessMessagesAsync(CancellationToken token) in C:\\dev\\repos\\aws-dotnet-messaging\\src\\AWS.Messaging.Lambda\\Services\\DefaultLambdaMessageProcessor.cs:line 92",
    "at AWS.Messaging.Lambda.DefaultLambdaMessaging.ProcessLambdaEventWithBatchResponseAsync(SQSEvent sqsEvent, ILambdaContext context) in C:\\dev\\repos\\aws-dotnet-messaging\\src\\AWS.Messaging.Lambda\\DefaultLambdaMessaging.cs:line 96",
    "at MessagingTestProject.Functions.Handler(SQSEvent evnt, ILambdaContext context) in C:\\dev\\repos\\aws-dotnet-messaging\\MessagingTestProject\\src\\MessagingTestProject\\Functions.cs:line 63",
    "at MessagingTestProject.Functions_Handler_Generated.Handler(SQSEvent __evnt__, ILambdaContext __context__) in C:\\dev\\repos\\aws-dotnet-messaging\\MessagingTestProject\\src\\MessagingTestProject\\obj\\Debug\\net8.0\\Amazon.Lambda.Annotations.SourceGenerator\\Amazon.Lambda.Annotations.SourceGenerator.Generator\\Functions_Handler_Generated.g.cs:line 60",
    "at Amazon.Lambda.RuntimeSupport.HandlerWrapper.<>c__DisplayClass26_0`2.<<GetHandlerWrapper>b__0>d.MoveNext()",
    "--- End of stack trace from previous location ---",
    "at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken)"
  ],
  "cause":   {
    "errorType": "InvalidDataException",
    "errorMessage": "'MessagingTestProject.GreetingMessage' is not a valid subscriber mapping. Available mappings: greetingMessage",
    "stackTrace": [
      "at AWS.Messaging.Serialization.EnvelopeSerializer.ConvertToEnvelopeAsync(Message sqsMessage) in C:\\dev\\repos\\aws-dotnet-messaging\\src\\AWS.Messaging\\Serialization\\EnvelopeSerializer.cs:line 152"
    ]
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@GarrettBeatty GarrettBeatty marked this pull request as ready for review March 6, 2025 18:49
@GarrettBeatty GarrettBeatty requested review from normj and philasmar March 6, 2025 18:49
@GarrettBeatty GarrettBeatty merged commit bdb0f18 into dev Mar 7, 2025
7 checks passed
@GarrettBeatty GarrettBeatty deleted the gcbeatty/bug branch March 7, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants