Skip to content

backtrace runs twice when a function fails #1

@Elsie19

Description

@Elsie19

File

#!/bin/bash
source ../base/backtrace.sh

function doomed_to_fail() {
    touch /root/test
}

doomed_to_fail

Output

touch: cannot touch '/root/test': Permission denied
Traceback (most recent call last):
  File "./test.sh", line 9, in main
    doomed_to_fail
  File "./test.sh", line 6, in doomed_to_fail
    touch /root/test
Exiting with status 1
Traceback (most recent call last):
  File "./test.sh", line 9, in main
    doomed_to_fail
Exiting with status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions