It depends on the spell
Per the rule description of Eldritch Cannon:
The cannon is a magical object.
Therefore, it obeys the rules for each spell as to how that spell interacts with objects. That is, there is no general rule. Rather, it's a case-by-case basis as listed in a spell's description.
Some spells say that they affect objects. For example, Fireball:
The fire spreads around corners. It ignites flammable objects in the area that aren't being worn or carried.
This doesn't require the object to make a saving throw. If it's flammable and not being held, it simply starts burning. So the fact that your character is holding the Eldritch Cannon prevents it from being ignited.
Or take Chain lightning:
You create a bolt of lightning that arcs toward a target of your choice that you can see within range. Three bolts then leap from that target to as many as three other targets, each of which must be within 30 feet of the first target. A target can be a creature or an object and can be targeted by only one of the bolts.
A target must make a Dexterity saving throw.
Chain lightning is an "AoE" spell that requires the caster to select discrete targets and s/he could specify that the cannon is included among the targets. If it is targeted in this way, th rules for the cannon include this info:
If it is forced to make an ability check or a saving throw, treat all its ability scores as 10 (+0).
But, in all cases, a spell (or ability) should explicitly state if/how it affects objects. Holding the cannon does not impart some extra level of defense unless the spell says it does.