[geany/geany-plugins] 6acdb3: added handling of errors, overall clean of the code, removed uneeded code