add some missing try and catch
This commit is contained in:
@@ -152,7 +152,16 @@ namespace Sernatur {
|
||||
}
|
||||
|
||||
private void reset_city () {
|
||||
cities = Ciudad.get_all_ciudades_in_region (conn, tour.ciudad.region.id_region);
|
||||
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 () {
|
||||
regions = Region.get_all_regiones (conn);
|
||||
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);
|
||||
|
||||
cities = Ciudad.get_all_ciudades_in_region (conn, tour.ciudad.region.id_region);
|
||||
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) => {
|
||||
|
Reference in New Issue
Block a user