Changeset 35242 for gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/java/org/atea/nlptools/koreromaoriinterface/TranscriptionServlet.java
- Timestamp:
- 2021-08-03T17:12:35+12:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy/src/main/java/org/atea/nlptools/koreromaoriinterface/TranscriptionServlet.java
r35241 r35242 23 23 import org.apache.logging.log4j.LogManager; 24 24 import org.apache.logging.log4j.Logger; 25 import org.atea.nlptools.koreromaoriinterface.exceptions.ReoTuhituhiException; 25 26 import org.atea.nlptools.koreromaoriinterface.models.AudioFilePart; 26 27 import org.atea.nlptools.koreromaoriinterface.models.MyTranscriptionResponse; … … 87 88 String[] audioFileKeys = audioFileKeysParameter.split("\\|"); 88 89 90 // Create our own representation of each part 89 91 ArrayList<AudioFilePart> audioFileParts = new ArrayList<AudioFilePart>(audioFileKeys.length); 90 92 for (String audioFileKey : audioFileKeys) … … 95 97 } 96 98 97 try 99 try 98 100 { 99 List<AudioFilePart> results = transcriptionService.GetTranscriptions(audioFileParts); 101 List<AudioFilePart> results = transcriptionService.getTranscriptions(audioFileParts); 102 100 103 List<MyTranscriptionResponse> responses = new ArrayList<MyTranscriptionResponse>(results.size()); 101 102 104 for (AudioFilePart result : results) { 103 105 responses.add(MyTranscriptionResponse.FromTranscriptionResult(result.getTranscriptionResult(), result.fileName)); … … 107 109 writer.append(json); 108 110 } 111 catch (ReoTuhituhiException rtex) 112 { 113 response.sendError(502, "Call to the Reo Tuhituhi API failed."); 114 } 109 115 catch (Exception ex) 110 116 { 111 response.sendError(500, " Call to the Reo Tuhituhi API failed." + ex);117 response.sendError(500, "Failed to process the request."); 112 118 logger.error("Failed to complete API call", ex); 113 119 }
Note:
See TracChangeset
for help on using the changeset viewer.