- (make-network-process
- :name "elpher-process"
- :host (elpher-address-host address)
- :service (elpher-address-port address)
- :filter (lambda (proc string)
- (setq elpher-selector-string (concat elpher-selector-string string)))
- :sentinel after)
- (process-send-string "elpher-process"
- (concat (elpher-address-selector address) "\n")))
+ (condition-case nil
+ (progn
+ (make-network-process :name "elpher-process"
+ :host (elpher-address-host address)
+ :service (elpher-address-port address)
+ :filter (lambda (proc string)
+ (setq elpher-selector-string
+ (concat elpher-selector-string string)))
+ :sentinel after)
+ (process-send-string "elpher-process"
+ (concat (elpher-address-selector address) "\n")))
+ (error
+ (elpher-with-clean-buffer
+ (insert (propertize "\n---- ERROR -----\n\n" 'face 'error)
+ "Failed to connect to " (elpher-get-address-url address) ".\n"
+ (propertize "\n----------------\n\n" 'face 'error)
+ "Press 'u' to return to the previous page.")))))