Initialize table in a Module but Break if criteria not met

I am initializing a table inside a function as follows:

f[a1_, a2_, a3_] := Module[{RM = Table[a1+a2+a3+i1, {i1, 1, 10}]}, Plus@@RM]

I am calling the function f multiple times with different values of a1, a2, a3 and want the function to exit, if 300