As reported to the FAA. Reports are unverified, and codes are left as the FAA publishes them.
What was found
FLAPS FAIL CAUTION MESSAGE. THE CREW DECLARED AN EMERGENCY, DIVERTED TO NEAREST FIELD AND LANDED WITHOUT INCIDENT. MAINTENANCE TROUBLESHOT, REMOVED AND REPLACED THE RIGHT HAND BRAKE AND POSITION SENSOR UNIT AND PERFORMED CHECKS IAW THE AMM. THE AIRCRAFT WAS RELEASED FOR SERVICE.