Add errors last

This commit is contained in:
Chase Tucker
2025-08-26 09:10:15 -07:00
parent 47405863d7
commit a196bffd41
7 changed files with 152 additions and 163 deletions

View File

@ -447,37 +447,43 @@ Service CassetteIsLastInWo(WoMatKey)
IsLastInWo = False$
ErrMsg = ''
If Unassigned(WoMatKey) or WoMatKey EQ '' or RowExists('WO_MAT', WoMatKey) NE True$ then
Error_Services('Add', 'invalid WO_MAT key')
ErrMsg = 'invalid WO_MAT key'
end
WO = Field(WoMatKey, '*', 1)
If WO EQ '' then
Error_Services('Add', 'WO# not found in WO_MAT record')
ErrMsg = 'WO# not found in WO_MAT record'
end
If Error_Services('NoError') and Num(WO) EQ False$ then
Error_Services('Add', 'WO# is not numeric')
If ErrMsg EQ '' and Num(WO) EQ False$ then
ErrMsg = 'WO# is not numeric'
end
CassNo = Field(WoMatKey, '*', 2)
If Error_Services('NoError') and CassNo EQ '' then
Error_Services('Add', 'Cassette# not found in WO_MAT record')
If ErrMsg EQ '' and CassNo EQ '' then
ErrMsg = 'Cassette# not found in WO_MAT record'
end
If Error_Services('NoError') and Num(CassNo) EQ False$ then
Error_Services('Add', 'Cassette# is not numeric')
If ErrMsg EQ '' and Num(CassNo) EQ False$ then
ErrMsg = 'Cassette# is not numeric'
end
If Error_Services('NoError') then
If ErrMsg EQ '' then
WoMatKeys = Xlate('WO_LOG', WO, WO_LOG_WO_MAT_KEY$, 'X')
If Error_Services('NoError') and WoMatKeys NE '' then
If WoMatKeys NE '' then
TotalCassettes = DCount(WoMatKeys, @VM)
IsLastInWo = TotalCassettes EQ CassNo
end else
ErrMsg = 'WO_MAT keys not found in WO_LOG for WO ':WO
end
end
If Error_Services('HasError') then
ErrMsg = Error_Services('GetMessage')
Response = IsLastInWo
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
If ErrMsg NE '' then
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = WOMatKey
@ -488,11 +494,6 @@ Service CassetteIsLastInWo(WoMatKey)
Error_Services('Add', ErrMsg)
end
Response = IsLastInWo
EndTick = GetTickCount()
Mona_Services('QueueLatencyAndCountMetrics', MonaResource, MetricName, StartTick, EndTick)
end service
@ -697,3 +698,4 @@ Service VerifyWOLogWOMatKeyColumn(WOMatKey)
end service