Looking for the feedback on suggested feature for rails credentials

Hi,

I’m looking for some suggestions like how to fix this issue mentioned here: data is not preserved in credentails.yml.enc file, in case of an error while saving it · Issue #34107 · rails/rails · GitHub

So, currently in case of an error(like indentation etc.) in credentials.yml.enc file, it discards the changes and exits out

of the editor. This leads to a situation where users have to write newly added credentials again.

Upon discussing it with Wojciech, I found a good place to start looking but it would really help if people here could also

throw some suggestions. basically where the error should be handled and what is the desired behavior.