Skip to content

WIP: Separate "invalid input" exceptions from "bad stuff while processing input" exceptions - #72

Closed
hhexo wants to merge 8 commits into
masterfrom
dd-some-exceptions-are-not-input-errors
Closed

hhexo wants to merge 8 commits into
masterfrom
dd-some-exceptions-are-not-input-errors

Conversation

@hhexo

@hhexo hhexo commented Sep 27, 2017

Copy link
Copy Markdown
Contributor

An unsupported format is not a user input error - it's an FDK error, we can't even begin to send events to the function code.

@hhexo hhexo changed the title An unsupported format is not a user input error - it's an FDK error WIP: Separate "invalid input" exceptions from "bad stuff while processing input" exceptions Sep 27, 2017
@hhexo

hhexo commented Sep 27, 2017

Copy link
Copy Markdown
Contributor Author

I'm going to look at doing our internal issue number 194 in this PR.

.stream()
.map((c) -> c.tryCoerceParam(ctx, param, evt))
.filter(Optional::isPresent)
.map(Optional::get).findFirst();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stream usage looks nice but it was actually broken because findFirst() can return null and the subsequent arg.orElseThrow would break. A for loop is also more readable.

@panga

panga commented Jun 23, 2018 •

Copy link
Copy Markdown

I'm sure sure if it solves my issue, JSON coercion is failing in my case when I send a null or empty message.

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