Welcome to Just Answer.
Sorry to hear about your problem.
D5 means that the washer thinks that the door is open while the washer was running. If the door was not open, you will need to test the lid switch and striker and replace as necessary.
If you need further help or clarification on this answer, please do not hesitate to reply to this post.
Thanks for asking your question at Just Answer.
Best of Luck, Brian
Please leave feedback at your convenience.
Verify that a small button on the inside edge where the door closes, is not broken off. If it has you will only see a hole where the button was. You will need to replace the lid switch if this is the case. Click here to learn more about testing the switch.
Pull out the dispenser drawer by pushing down on the tab and removing the drawer; there is a cord you can manually pull to unlock the door lock. This works for the models that have the drawer on top.
For models that have the drawer in the front, unfortunately, these models do not have a manual unlock. Your problem is probably a faulty lid lock/ interlock and I wouldn't try to force the door lock since this can do damage, best thing to do is call a qualified service technician to come and release the lid; I believe the front or top cover has to be removed to access the latch.