Skip to content

displayException: Remove trailing newline#37

Merged
parsonsmatt merged 2 commits intoparsonsmatt:masterfrom
9999years:wiggles/dux-3329-remove-trailing-newline-from-displayexception
Apr 11, 2025
Merged

displayException: Remove trailing newline#37
parsonsmatt merged 2 commits intoparsonsmatt:masterfrom
9999years:wiggles/dux-3329-remove-trailing-newline-from-displayexception

Conversation

@9999years
Copy link
Copy Markdown
Contributor

@9999years 9999years commented Apr 11, 2025

In #36, I restructured the AnnotatedException displayException implementation so that instead of being of the form:

displayException =
    unlines [ ... ] <> callStackMessage
    where
        callStackMessage = prettyCallStack frames

It was of the form:

displayException =
    unlines $ [ ... ] <> callStackMessage
    where
        callStackMessage = [prettyCallStack frames]

I didn't realize that unlines adds a trailing newline, which is generally the wrong behavior for displayException instances.

This change replaces unlines with concat . intersperse "\n" in order to regain the correct behavior.

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR.
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts).

In parsonsmatt#36, I restructured the `AnnotatedException` `displayException`
implementation so that instead of being of the form:

    displayException =
        unlines [ ... ] <> callStackMessage
        where
            callStackMessage = prettyCallStack frames

It was of the form:

    displayException =
        unlines $ [ ... ] <> callStackMessage
        where
            callStackMessage = [prettyCallStack frames]

I didn't realize that `unlines` adds a trailing newline, which is
generally the wrong behavior for `displayException` instances.

This change replaces `unlines` with `concat . intersperse "\n"` in order
to regain the correct behavior.
@9999years 9999years marked this pull request as ready for review April 11, 2025 18:21
@parsonsmatt parsonsmatt merged commit 805a0ac into parsonsmatt:master Apr 11, 2025
9 checks passed
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.

2 participants