Commit b742a313b232a74e9170175d5e58e6dfbd4a2dd4
1 parent
f25294b3
Exists in
master
and in
1 other branch
Tratamento de exceções
Showing
3 changed files
with
16 additions
and
4 deletions
Show diff stats
servico/src/serviceWindowGenerationFromRec.cpp
... | ... | @@ -166,7 +166,11 @@ void ServiceWindowGenerationFromRec::notifyEndOfRenderization() { |
166 | 166 | |
167 | 167 | void ServiceWindowGenerationFromRec::notifyEnd(int sentences_size){ |
168 | 168 | PRINTL(util::_DEBUG, "Service REC recebeu: %d sentenças.\n", sentences_size); |
169 | - setSizeOfSubtitles(sentences_size); | |
169 | + try{ | |
170 | + setSizeOfSubtitles(sentences_size); | |
171 | + }catch(ServiceException &ex) { | |
172 | + finish = true; | |
173 | + } | |
170 | 174 | } |
171 | 175 | |
172 | 176 | bool ServiceWindowGenerationFromRec::isRunning(){ | ... | ... |
servico/src/serviceWindowGenerationFromSubtitle.cpp
... | ... | @@ -196,7 +196,6 @@ void ServiceWindowGenerationFromSubtitle::notifySubtitle(unsigned char *subtitle |
196 | 196 | for (string::size_type i=0; i< subt.length(); ++i) { |
197 | 197 | glosa += std::toupper(subt[i], loc); |
198 | 198 | } |
199 | - cout << glosa << endl; | |
200 | 199 | notifyRenderer(glosa); |
201 | 200 | } |
202 | 201 | } |
... | ... | @@ -228,7 +227,12 @@ void ServiceWindowGenerationFromSubtitle::notifyEndOfRenderization() { |
228 | 227 | |
229 | 228 | void ServiceWindowGenerationFromSubtitle::notifyEnd(int sub_size) { |
230 | 229 | PRINTL(util::_DEBUG, "Service Subtitle recebeu: %d legendas.\n", sub_size); |
231 | - setSizeOfSubtitles(sub_size); | |
230 | + try{ | |
231 | + setSizeOfSubtitles(sub_size); | |
232 | + }catch(ServiceException &ex) { | |
233 | + finish = true; | |
234 | + } | |
235 | + | |
232 | 236 | } |
233 | 237 | |
234 | 238 | bool ServiceWindowGenerationFromSubtitle::isRunning() { | ... | ... |
servico/src/serviceWindowGenerationFromText.cpp
... | ... | @@ -129,7 +129,11 @@ void ServiceWindowGenerationFromText::notifyEndOfRenderization() { |
129 | 129 | |
130 | 130 | void ServiceWindowGenerationFromText::notifyEnd(int line_size) { |
131 | 131 | PRINTL(util::_DEBUG, "Service Text recebeu: %d linhas.\n", line_size); |
132 | - setSizeOfSubtitles(line_size); | |
132 | + try{ | |
133 | + setSizeOfSubtitles(line_size); | |
134 | + }catch(ServiceException &ex) { | |
135 | + finish = true; | |
136 | + } | |
133 | 137 | } |
134 | 138 | |
135 | 139 | bool ServiceWindowGenerationFromText::isRunning() { | ... | ... |