add nanapi's test error handling