report-error

Section: Tk Built-In Commands (n)
Updated: 3.1
Index Return to Main Contents
 

NAME

report-error - Command invoked to process errors  

SYNOPSIS

(report-error head message obj)

 

DESCRIPTION

Report-error is called by the interpreter when an error occurs. This procedure is written in Scheme and can be by an application which needs to handle redefined to handle errors. The head argument is a string which identify the kind of error. The head argument contains the error message and obj contains the object which causes the error (or the empty list when there is no object to incriminate).

The STk library includes a default report-error procedure that posts a dialog box containing the error message and offers the user a chance to see a stack trace showing where the error occurred and its associated environment..

If an error occurs while is report-error execution, the interpreter detect that the procedure is buggy and it redirect further messages on the standard error port.

Hereafter is a simple non-graphical error reporter. (define (report-error head message obj)
  (let ((port (current-error-port)))
    ;; Display message
    (format port "~A: ~A ~Sn"  head message obj)
    ;; Display stack
    (let ((stack (%get-eval-stack))          (env (%get-environment-stack)))

      (for-each (lambda (x y) (format port "~A ~A x (uncode y)))                 env
                stack))))


 

Index

NAME
SYNOPSIS
DESCRIPTION

This document was created by man2html, using the manual pages.
Time: 15:21:49 GMT, November 05, 2024