Modified elfinsToJsonArray implementation to benefit from more fine
grained exception.