Skip to content

Commit

Permalink
Issue #559: A response Signal with an invalid type leads to HTTP stat…
Browse files Browse the repository at this point in the history
…us 500 as this should never happen.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
  • Loading branch information
Juergen Fickel committed Oct 26, 2021
1 parent 15c1e79 commit 81f1900
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import javax.annotation.concurrent.Immutable;

import org.eclipse.ditto.base.model.common.HttpStatus;
import org.eclipse.ditto.base.model.common.ResponseType;
import org.eclipse.ditto.base.model.entity.id.EntityId;
import org.eclipse.ditto.base.model.entity.id.WithEntityId;
Expand Down Expand Up @@ -144,6 +145,7 @@ private static SemanticSignalType tryToParseSemanticSignalType(final Signal<?> s
// This should never ever happen in production as implementations
// of Signal are supposed to have a valid type.
throw UnsupportedSignalException.newBuilder(signal.getType())
.httpStatus(HttpStatus.INTERNAL_SERVER_ERROR)
.dittoHeaders(signal.getDittoHeaders())
.description("The signal has an invalid type: " + e.getMessage())
.cause(e)
Expand Down

0 comments on commit 81f1900

Please sign in to comment.