If we look at the source custom-save-allin cus-edit.el, we find:
(defun custom-save-all ()
"Save all customizations in `custom-file'."
(when (and (null custom-file) init-file-had-error)
(error "Cannot save customizations; init file was not fully loaded"))
, . emacs --debug-init, Emacs Lisp .