home *** CD-ROM | disk | FTP | other *** search
- #include "error.ch"
-
-
- ****
- * errorsys.prg
- *
-
- #define OUT(str) __OUTSTD( str )
- #define OUTNL(str) __OUTSTD( Chr(13) + Chr(10) + str )
-
-
- ***
- * ErrorSys()
- *
-
- proc ErrorSys()
- ErrorBlock( {|e| DefError(e)} )
- return
-
-
- ***
- * DefError()
- *
- static func DefError(e)
- local i
-
- if ( e:genCode == EG_OPEN .and. NetErr() .and. e:canDefault )
- return (.f.) /* ignore */
- end
-
- /* put message to STDOUT */
- OUTNL( "Error" )
-
- if ( !Empty(e:subsystem()) )
- OUT( " " + e:subsystem() + "[" + LTrim(Str(e:subCode())) + "]" )
- end
-
- if ( !Empty(e:description()) )
- OUT( " " + e:description() )
- end
-
- if ( !Empty(e:operation()) )
- OUT( ": " + e:operation() )
- end
-
- if ( !Empty(e:filename()) )
- OUT( ": " + e:filename() )
- end
-
-
- i := 2
- while (.t.)
- OUTNL( "Called from " + Trim(ProcName(i)) + ;
- "(" + Alltrim(Str(ProcLine(i))) + ") " )
-
- i++
-
- if ( ProcName(i) == "" )
- ERRORLEVEL(1)
- QUIT
- end
- end
-
- return (.f.)
-