I found a easy solution to this.
First go into safe mode and find out if its a hardware or software problem. Restart phone, press both volume and power buttons while its restarting to get there. While in safe mode try the charger. If you get the same $@$* its the hardware, so theres some kind of moisture dmg. Follow the drying instructions.
If it goes away then its something in the software or operating system. Luckily i found a quick easy fix. Boot phone normally and just goto setting and use the device maintenance option. This should fix the problems if its a usb cache or memory error.
If problem persists you might have to wipe the storage/disc partition or try clearing cache manually. The details for this you can find easily with a google search. Just type (phone model here) wipe partition OR wipe cache
Allright, hope this helps guys.