add some missing try and catch

This commit is contained in:
Chris Cromer 2019-01-19 17:45:51 -03:00
parent 9ff7178ed5
commit 994acf957a
Signed by: cromer
GPG Key ID: 39CC813FF3C8708A

View File

@ -152,7 +152,16 @@ namespace Sernatur {
}
private void reset_city () {
try {
cities = Ciudad.get_all_ciudades_in_region (conn, tour.ciudad.region.id_region);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
if (cities.length () > 0) {
cities.sort_with_data ((a, b) => {
@ -328,7 +337,16 @@ namespace Sernatur {
* Initialize what is needed for this window
*/
public void initialize () {
try {
regions = Region.get_all_regiones (conn);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
regions.sort_with_data ((a, b) => {
return strcmp (a.nombre_region, b.nombre_region);
@ -371,7 +389,16 @@ namespace Sernatur {
city.set_model (city_list_store);
try {
cities = Ciudad.get_all_ciudades_in_region (conn, tour.ciudad.region.id_region);
}
catch (Error e) {
#if DEBUG
error (e.message);
#else
warning (e.message);
#endif
}
if (cities.length () > 0) {
cities.sort_with_data ((a, b) => {