Js Picture failed to load how to use try catch

Picture src is assigned to it through js.
Picture failed to load automatically modify its suffix.
but console will type a lot of error prompts, look unaccustomed, affecting debugging. As shown in the figure below
how to use try catch to shield error prompts?
or how to prevent an image from displaying an error message when it fails to load?


There is a onerror event in

html: . For more information, please see http://www.runoob.com/jsref/event-img-onerror.html

.

I hope I can help you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46474-4cf3d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46474-4cf3d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?