Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

use kv2json for Error Body build.#6

Merged
mashiike merged 1 commit into
masterfrom
feature/fix-error-report-body-builder-use-kv2json
Jul 2, 2020
Merged

use kv2json for Error Body build.#6
mashiike merged 1 commit into
masterfrom
feature/fix-error-report-body-builder-use-kv2json

Conversation

@mashiike

@mashiike mashiike commented Jul 2, 2020

Copy link
Copy Markdown

background

If there is something like the following that breaks the JSON structure in the stack trace, the JSON of Body will be broken.

error \"hoge\" is not found

In this case,

{\"errorMessage\": \"ERROR_MESSAGE\", \"errorType\": \"ERROR_TYPE\", \"stackTrace\": \"error \"hoge\" is not found\"}"

The problem is that JSON is not escaped when creating the Body.

content

use kv2json https://github.com/Songmu/App-KV2JSON

kv2json is very useful when assembling json from environment variables.
By generating an Error Body using kv2json, it is possible to generate it no matter what character string is in it.

@mashiike mashiike requested a review from fujiwara July 2, 2020 05:51

@fujiwara fujiwara left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@mashiike mashiike merged commit f783614 into master Jul 2, 2020
@mashiike mashiike deleted the feature/fix-error-report-body-builder-use-kv2json branch July 15, 2020 09:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants