aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-09-29 16:22:42 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-09-29 16:38:13 -0700
commitadf7f77e1a1ec4f1c6a94b362171b335525bb907 (patch)
tree8c78fe484d061f018b9d7cc9f0ce0d3d447149e6
parent35028adc11107f035aa0c930d2f70a7dff2841be (diff)
downloadconsfigurator-adf7f77e1a1ec4f1c6a94b362171b335525bb907.tar.gz
programmatic application of properties: error out if no *CONNECTION*
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property.lisp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/property.lisp b/src/property.lisp
index e846c46..b43fe8c 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -300,6 +300,13 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
,@(and
(getf ,slotsv :apply)
`((defun-with-args ,,namev args ,,lambdav
+ (unless *connection*
+ (simple-program-error
+"Attempt to programmatically apply property with no connection established.
+
+Common causes of this error are (i) missing the '.' to enable the dotted
+propapp rules; and (ii) inadvertently calling the contents of a property's
+function cell, instead of constructing a propapp, within DEFPROPSPEC."))
;; Properties with :HOSTATTRS subroutines which set
;; new hostattrs should not be used programmatically
;; in this way, so issue a warning.