Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pleroma pleroma
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 646
    • Issues 646
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 88
    • Merge requests 88
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PleromaPleroma
  • pleromapleroma
  • Merge requests
  • !3489

Fix errors in ErrorView

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alex Gleason requested to merge errorview-json-fix into develop Jul 27, 2021
  • Overview 1
  • Commits 3
  • Pipelines 1
  • Changes 2

Yo dawg I heard you like errors... well the ErrorView itself was causing errors making it unable to send a response.

Screenshot_from_2021-07-27_08-33-11

It turns out ErrorView couldn't render properly because of no function clause matching in Plug.Conn.resp/3

That function clause? is_binary(body)

Instead, a Map was being passed into the body. It should have been encoded by Jason first. I looked at the Conn, and it had format: "activity+json". It turns out Phoenix needs to know about this if it wants to render the error. It only knows about regular "json" so far.

The fix is simple: just tell Phoenix about "activity+json" by adding it to the config: https://stackoverflow.com/a/48986889

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: errorview-json-fix