Skip to content

improve error message for call depth limit #85

@ee7

Description

@ee7

Reported by @axtens in Slack:

Crashed the nim runner with the following code in Reverse String

import sequtils, strutils

var seq_reverse: proc( str:  seq[char]): seq[char]

seq_reverse = proc( str:  seq[char]): seq[char] = 
 if str.len == 1:
   str[0..0]
 else:
   var slice = str
   slice.delete(0,0)
   #let revved = reverse(slice)
   concat(seq_reverse(slice), str[0..0])
   
proc reverse*(str: string): string =
 cast[string](seq_reverse(toSeq(str)))

echo reverse("dog")

Worked fine in Nim Playground, see https://play.nim-lang.org/#ix=3s0y


The error:

parsejson.nim(522)       raiseParseErr
Error: unhandled exception: /mnt/exercism-iteration/results.json(1, 0) Error: { expected [JsonParsingError]

The website produces the message:

An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that's causing our systems to break.

Please check your code, and if nothing seems to be wrong, try running the tests again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions