Permalink
Browse files

making the exception handling a little more specific

  • Loading branch information...
dyoo committed Apr 23, 2013
1 parent 951b4a1 commit a943fbc39c595524cd42c0afc41017edd5523b0d
Showing with 6 additions and 2 deletions.
  1. +6 −2 sandboxed-server.rkt
View
@@ -36,9 +36,13 @@
(let sandbox-loop ()
- (with-handlers ([exn:fail?
+ (with-handlers ([exn:fail:resource?
(lambda (exn)
- (printf "server died prematurely from the sandbox? ~s\n"
+ (printf "server died from resource limits? ~s\n"
+ (exn-message exn)))]
+ [exn:fail:sandbox-terminated?
+ (lambda (exn)
+ (printf "server died prematurely? ~s\n"
(exn-message exn)))])
(let loop ()
(parameterize ([sandbox-memory-limit (current-memory-limit)]

0 comments on commit a943fbc

Please sign in to comment.