Originally I had the phoenix live-view responsible for casting values coming from the client, strictly requiring that all values were correct before being passed in to Config.update. This is obviously not that great... it would be much nicer if Config.update returned either :ok, or {:error, :cast_error} or something like that. This would be a nicer developer experience. As of right now, it will crash with a pattern match error, which is not ideal.
Originally I had the phoenix live-view responsible for casting values coming from the client, strictly requiring that all values were correct before being passed in to
Config.update
. This is obviously not that great... it would be much nicer ifConfig.update
returned either:ok
, or{:error, :cast_error}
or something like that. This would be a nicer developer experience. As of right now, it will crash with a pattern match error, which is not ideal.