Skip to content

crash when stack level too deep while printing error message #58

@Jomy10

Description

@Jomy10

I got a crash because of a try! at:

let exceptionClass = try! exception.get("class")

The error message was "stack level too deep". However, when I turned it into a try?, the error message printed fine, but without the exceptionClass name.

I can open a pr for this, but I wasn't sure how you'd like to see this fixed. I have this:

public var description: String {
    if let exceptionClass = try? exception.get("class") {
        return "\(exceptionClass): \(exception)"
    } else {
        return "\(exception)"
    }
}

Also don't know if there's a better way to get the exception name without this error to happen.

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