input: Write a function to calculate the sum of digits of a given number. If the given number is a non-negative integer, return the sum of its digits. If the number is negative, return -1 as an error code.
  
  assert calculate_sum_of_digits(6342) == 15
  assert calculate_sum_of_digits(0) == 0
  assert calculate_sum_of_digits(-123) == -1
  assert calculate_sum_of_digits(12345) == 15
output: def calculate_sum_of_digits(num):
      if num < 0:
          return -1
      return sum(int(digit) for digit in str(num))