network: Catch errors when reading devices

NetworkManager added support for a new device - NMDeviceWifiP2P - but
did not add the corresponding enum value in NMDeviceType. The return
value for nm_device_get_device_type() is therefore "illegal" for the
newly added device, and gjs throws an exception.

This should ultimately be fixed in libnm, but as errors when adding
one device shouldn't interfere with adding any other devices, catching
exception is a good idea anyway, so do just that.

#1023
4 jobs for !448 with wip/fmuellner/fix-nm-icon in 7 minutes and 2 seconds (queued for 3 seconds)
detached
Status Job ID Name Coverage
  Review
passed #238211
check_commit_log

00:04:42

 
  Build
passed #238212
build

00:01:40

 
  Test
passed #238213
test

00:00:40

passed #238214
test-pot

00:00:38