File: catch_missing_file.js

package info (click to toggle)
cgal 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 144,912 kB
  • sloc: cpp: 810,858; ansic: 208,477; sh: 493; python: 411; makefile: 286; javascript: 174
file content (12 lines) | stat: -rw-r--r-- 285 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
var good = false
try {
    include("missing-file")
} catch (e)
{
    print_exception_and_bt(e)
    if(!e.toString().match(/No such file or directory/))
        throw "Wrong exception!"
    good = true
}
if(!good) throw "The exception was not caught!"
print("OK in catch_missing_file")