1. 22 Oct, 2014 7 commits
    • Dan Winship's avatar
      libnm: drop unused NMRemoteConnectionError · 5632ac67
      Dan Winship authored
      NMRemoteConnection used to return
      NM_REMOTE_CONNECTION_ERROR_DISCONNECTED if you tried to operate on a
      connection that had been disconnected from its D-Bus proxy. But this
      disappeared in the gdbus port (since gdbus doesn't emit a signal when
      it happens, so it's harder to notice. And it's not clear why
      NMRemoteConnection did this when no other class did anyway...).
      5632ac67
    • Dan Winship's avatar
      libnm-core, core: register NMConnectionError with D-Bus · 9c67b6fb
      Dan Winship authored
      Register NMConnectionError with D-Bus on both sides, so that, eg,
      connection validation failures in the daemon will translate to the
      correct error codes in the client.
      9c67b6fb
    • Dan Winship's avatar
      libnm-core: add nm-errors.[ch] · b1bcfa8f
      Dan Winship authored
      Add nm-errors.[ch], and move libnm-core's two error domains
      (NMConnectionError and NMCryptoError) there.
      
      NMCryptoError wasn't previously visible, but it can be returned from
      some public API, so it should be.
      b1bcfa8f
    • Dan Winship's avatar
      libnm-core: fix up/simplify NMCryptoError · 663a06b6
      Dan Winship authored
      Many of NMCryptoError's codes would basically never be useful for
      programs to distinguish between. Streamline the codes, and fix the
      enumeration member names to start with "NM_CRYPTO_ERROR_" rather than
      "NM_CRYPTO_ERR_".
      663a06b6
    • Dan Winship's avatar
      libnm-core: merge NMSetting*Error into NMConnectionError · 2d8e7bd2
      Dan Winship authored
      Each setting type was defining its own error type, but most of them
      had exactly the same three errors ("unknown", "missing property", and
      "invalid property"), and none of the other values was of much use
      programmatically anyway.
      
      So, this commit merges NMSettingError, NMSettingAdslError, etc, all
      into NMConnectionError. (The reason for merging into NMConnectionError
      rather than NMSettingError is that we also already have
      "NMSettingsError", for errors related to the settings service, so
      "NMConnectionError" is a less-confusable name for settings/connection
      errors than "NMSettingError".)
      
      Also, make sure that all of the affected error messages are localized,
      and (where appropriate) prefix them with the relevant property name.
      
      Renamed error codes:
      
      NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND
      NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET
      
      Remapped error codes:
      
      NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING
      NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      
      Dropped error codes (were previously defined but unused):
      
      NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
      NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED
      NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
      NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
      NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
      NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
      NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
      2d8e7bd2
    • Dan Winship's avatar
      libnm-core: clean up NMConnectionError · aeb3d093
      Dan Winship authored
      Rename NM_CONNECTION_ERROR_UNKNOWN to NM_CONNECTION_ERROR_FAILED,
      following GError best practices.
      
      Replace NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND ("no
      NMSettingConnection") with a more generic
      NM_CONNECTION_ERROR_MISSING_SETTING. Use that new code in a few places
      that had previously been using NM_CONNECTION_ERROR_SETTING_NOT_FOUND,
      which was supposed to mean "the setting that you asked about doesn't
      exist", not "the connection is invalid because it's missing a required
      setting".
      
      Clarify that NM_CONNECTION_ERROR_INVALID_SETTING can be used for any
      "invalid or inappropriate NMSetting", not just a "conflicting" one.
      (But fix a case in nm_connection_update_secrets() that was returning
      INVALID_SETTING when it should have been return-if-failing instead.)
      
      For both MISSING_SETTING and INVALID_SETTING, always prefix the error
      message with "setting-name: ", just like we do with the various
      NMSetting MISSING_PROPERTY and INVALID_PROPERTY errors. And make sure
      that the error message is marked for localization.
      
      Drop NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID, which is pretty
      pointless; it was only used in the case where connection.type was the
      name of a valid setting type that is not a base setting type. Instead,
      just return NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY for
      connection.type in this case (which is what the code already did when
      connection.type was completely unrecognized).
      aeb3d093
    • Dan Winship's avatar
      libnm-core: drop nm_setting_lookup_type_by_quark() · a7b1ee77
      Dan Winship authored
      nm_setting_lookup_type_by_quark() was only ever used in places that
      were still mistakenly assuming the old style of nm_connection_verify()
      errors, where the error message would contain only a property name and
      no further explanation. Fix those places to assume that the error will
      contain a real error message, and include both the setting name and
      the property name.
      
      Given that, there's no longer any need for
      nm_setting_lookup_type_by_quark(), so drop it.
      a7b1ee77
  2. 21 Oct, 2014 8 commits
  3. 20 Oct, 2014 15 commits
  4. 19 Oct, 2014 10 commits