I am trying to debug an error, I got a “no exception exception” when I first ran it and then later inserted a try / except block to print everything that was.
try: #some code except BaseException, e: print str(e)
This creates an empty output line, any ideas what it could be?
EDIT: Sorry, hoped there was a specific reason why the error message might be empty. There is no stack trace output, which is why I have to force the try / except block in the first place, I am still programming this thing, so I just let the compiler catch the errors for now. The actual code that throws the error is in the Django application, so it will have some functions from Django.
try: if len(request.POST['dateToRun']) <= 0: dateToRun = Job.objects.filter(id=jobIDs[i]).values()['whenToRun'].split(' ')[0] if len(request.POST['timeToRun']) <= 0: timeToRun = Job.objects.filter(id=jobIDs[i]).values()['whenToRun'].split(' ')[1] except BaseException, e: print str(e)
This is the code in the view function. Identifiers jobID is an identifier containing key pairs of values in the format ## Selection: ## (i.e. 17Selection: 17). Sorry I forgot to post this initially.
EDIT: repr (e) provided me with TypeError (), which is better than knowing nothing.
python exception
avorum
source share