Edit the python code to add try-except blocks for any potential error.
def function(num1, num2):
 result = num1/num2;
 return result;
def function(num1, num2):
 try:
 result = num1/num2;
 return result;
 except ZeroDivisionError:
  print("Division by 0 not allowed")