Custom Error constructor in `timeout` function