/// <summary>
 /// Updates the account information.
 /// </summary>
 public void updateAccountInformation()
 {
     try
     {
         accountInfo.update();
         onError?.Invoke(this, null);
     }
     catch (GW2APIComponent.GW2Components.Exceptions.BaseGw2Exception ex)
     {
         if (onError != null)
         {
             if (ex.GetType() == typeof(GW2APIComponent.GW2Components.Exceptions.APIKeyLacksPermissionException))
             {
                 var v = ex as GW2APIComponent.GW2Components.Exceptions.APIKeyLacksPermissionException;
                 Dispatcher.Invoke(new Action(() =>
                 {
                     onError(this, new ErrorInfo(new List <string>()
                     {
                         v.Message, v.MissingPermission
                     }));
                 }));
             }
             else
             {
                 Dispatcher.Invoke(new Action(() =>
                 {
                     onError(this, new ErrorInfo(ex.Message));
                 }));
             }
         }
     }
 }