# FTimerDelegate Throws Vague Exception

**URL:** <https://forums.unrealengine.com/t/ftimerdelegate-throws-vague-exception/420856>\
**Category:** C++\
**Tags:** breakpoint, exception, timer, unreal-engine, delegates, CPP, question\
**Created:** [March 25, 2018, 7:21pm UTC](https://forums.unrealengine.com/t/ftimerdelegate-throws-vague-exception/420856 "2018-03-25T19:21:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janyx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Janyx](https://forums.unrealengine.com/u/Janyx)\
**Post date:** [March 25, 2018, 7:21pm UTC](https://forums.unrealengine.com/t/ftimerdelegate-throws-vague-exception/420856/1 "2018-03-25T19:21:39Z")

</div>

I am trying to implement an weapon swapping system using the FTimerDelegate. The basic Idea is that `equip` is called once `holster` is finished. I declare my FTimerDelegate like so:

```
UCLASS()
class AXLCharacter : public ACharacter
{
	GENERATED_BODY()

public: 

        // .....

	FTimerDelegate TimerDelegate_SwitchWeapon;

        //...
}

```

My code that implements the FTimerDelegate is below:

```
float AXLCharacter::EquipWeapon(uint32 Weapon)
{
	float Duration = 0.0f;
	if (CharacterWeapons->Inventory.Num() > 0)
	{
		if (CurrentWeapon)
		{
			float Duration = HolsterWeapon() * 10;

			TimerDelegate_SwitchWeapon.BindUFunction(this, FName("EquipWeapon"), Weapon);
			GetWorldTimerManager().SetTimer(TimerHandle_SwitchWeapon, TimerDelegate_SwitchWeapon, Duration, false);
		}
		else
		{
			try
			{
				CurrentWeapon = CharacterWeapons->Inventory[Weapon];
				Duration = CurrentWeapon->StartEquip("RightHand");
			}
			catch (std::exception const & ex)
			{
				ex;
			}
		}
	}
	return Duration;
}
float AXLCharacter::HolsterWeapon()
{
	float Duration = 0.0f;
	if (CurrentWeapon)
	{
		Duration = CurrentWeapon->StartUnequip();
		CurrentWeapon = NULL;
	}
	return Duration;
}

```

The initial equip works great and holster the weapon works great. But when switch the holster section of the code run fine a the timer successfully calls equip. but when trying to execute the code `DelegateInstanceInterface.h` throw the following exception:

 ![235032-screenshot-14.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/d/24d30ada0fd777c961ecb33a72602590f2a58662.png)

This give me no information, I have no idea what the issue it. If someone has any ideas – I would appreciate the help
