Better explain the source of error in exception message

If user forgets to fill in the path_bandwidth, error message was
not explicit enough to help to correct.

Signed-off-by: EstherLerouzic <esther.lerouzic@orange.com>
Change-Id: I776e95b6f859c3b643786b6e802f3c0bcbc1de76
This commit is contained in:
EstherLerouzic
2020-01-24 17:05:14 +01:00
parent e24b766cdc
commit 47b4f87bc5

View File

@@ -120,7 +120,10 @@ class OMS:
"""
if (nvalue is None or mvalue is None or isinstance(nvalue, float)
or isinstance(mvalue, float) or mvalue == 0):
raise SpectrumError('could not assign None values')
raise SpectrumError(f'Could not assign N {nvalue}, M {mvalue}. N and M must be ' + \
'integer, with M>0. N and M may be derived from service' + \
' path_bandwidth request. Please check that path_bandwidth is' + \
' positive and non zero.')
startn, stopn = mvalue_to_slots(nvalue, mvalue)
# print(f'startn stop n {startn} , {stopn}')
# assumes that guardbands are sufficient to ensure that assigning a center channel