How can I avoid getting an error when passing as argument to the function do-http-request an invalid host.
Is there any way that I can catch the error like the Java's exception-handling mechanism ?
AllegroServe Exception Handling
185 Views Asked by utxeee At
1
There are 1 best solutions below
Related Questions in EXCEPTION
- Python twisted not catching exception
- Proper use of custom exceptions
- C++ Mongodb driver, not working
- C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application
- Hashing String (SHA-256) in an ActionListener class
- Do we have to mention exception type in java?
- How can I make Eclipse (or javac) warn about over-inclusive throws clauses
- Why can an Exception not be rethrown in the BackgroundWorker RunWorkerCompleted event
- How can I set the the expected Exception type for a catch statement with a parameter I've passed into a method?
- Why do I get an IndexOutOfBoundsException when my else should prevent it?
- crypto.BadPaddingException: data hash wrong (EKYC-Response)
- How to print the first line from a traceback stack
- java.lang.ArrayIndexOutOfBoundsException object array
- Passing keyword arguments to custom exceptions - anomaly
- Unauthorised access to folders when creating xml file
Related Questions in LISP
- Intercept and modify user input in Common Lisp
- Read next line when loading file in Common Lisp
- Calling CCL + Quicklisp script as executable with command line arguments and achieving the desired output
- Avoiding echos in Clozure lisp (noob)
- Backquote String Interpolation
- Structuring large Lisp applications
- If strings are vectors, why are they immutable?
- Invalid specialized parameter in method lambda list
- Emacs init.el and Elisp and equivalent of common lisp every-p function
- EVAL/APPLY: too many arguments given to F
- Insertion into a list doesn't reflect outside function whereas deletion does?
- How to traverse a tree in Clojure while collecting the value from each node node?
- in clojure, function argument type mismatch
- In Lisp is the function `1+` just syntactic sugar?
- Search function in lisp
Related Questions in COMMON-LISP
- EMACS-Live + Slime error at startup
- Local dynamic binding in common lisp
- Running compiled lisp program with clisp-2.49 on OS X
- What does the non-terminating-p argument of set-macro-character do?
- Updating the window in response to CLIM frame commands
- What is a common-lisp analogue of python's argparse?
- Anonymous methods in common lisp
- Read next line when loading file in Common Lisp
- Calling CCL + Quicklisp script as executable with command line arguments and achieving the desired output
- Jump to function definition in Emacs by mouse-click
- Avoiding echos in Clozure lisp (noob)
- where is the text printed by C printf
- Backquote String Interpolation
- Structuring large Lisp applications
- If strings are vectors, why are they immutable?
Related Questions in ALLEGRO-CL
- AllegroServe Exception Handling
- ASDF initialize-source-registry bug?
- Allegro CL Lisp editor
- strange behaviour of (delete .. in Allegro Lisp
- Object Address in Memory Common Lisp
- How can I do setf on a struct's accessors when using intern
- Weird non-lisp errors with capturing labels with a lambda and `reduce`
- Creating a hidden file in Common Lisp
- Can I use C++ Wrappers made in Allegro Common Lisp in SBCL or CLISP
- Allegro CL, Debugging functions step by step
- Allegro CL freezes when calling (read) function
- What's so special about the form, img, span, and table tags in AllegroServe's htmlgen?
- why is the warning sign popping out? in lisp programming
- pprint in Allegro CL
- Lisp, Error: Comma not inside a backquote. [file position = 762]
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Sure, CL has a very nice condition system. One easy option would be wrapping the call to
do-http-requestinignore-errors, which returnsnil(and the condition as a second value) if an error condition was signalled in the wrapped code. You could then check fornilafterwards.If you want something more like exception handling in Java, just use
handler-caseand add an appropriate error clause (I don't have AllegroServe installed, but I suppose you get asocket-errorfor providing a wrong URL – just change that part if I misread):If you need
finally-like functionality, useunwind-protect:You can even get more fancy, and e.g. use
handler-bindto handle the condition stack upwards by invoking a restart somewhere down the stack, without unwinding it. For example, ifdo-http-requestprovided a restart to try again with another URL, you could handle your error condition by invoking that restart with a new URL to retry. I just mention this for the sake of completeness – it would be overkill for your use case, but being able to resume (possibly expensive) computations easily can be a rather convenient feature.