Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* Adator. prog.
  + feladatsor
  + quick link

Teaching

* Prog. for Data Sci.
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2025/26/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Exception properties

From the book Programming in D.

  • .file: The source file where the exception was thrown from
  • .line: The line number where the exception was thrown from
  • .msg: The error message
  • .info: The state of the program stack when the exception was thrown
  • .next: The next collateral exception
(1) example
import std.stdio;

void main()
{
    try
    {
        throw new Exception("something went wrong");
    }
    catch (Exception e)
    {
        writeln(e);
        /*
object.Exception@/home/jabba/Dropbox/d_lang/b01-exception-properties/main.d(9): something went wrong
----------------
??:? _Dmain [0x55de4aa038f4]
        */

        writeln(e.file); // /home/jabba/Dropbox/d_lang/b01-exception-properties/main.d
        writeln(e.line); // 9
        writeln(e.msg); // something went wrong
        writeln(e.info); // ??:? _Dmain [0x5588542ec8f8]
    }
}
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 September 02, 20:24