@@ -203,7 +203,14 @@ public void handleError(GeneralError generalError) {
203203            Observable .just (response )
204204                    .compose (rx (null ))
205205                    .map (s  -> {
206-                         BaseInfo  resultInfo  = APIService .fruit ().fromHtml (s , CreateTopicPageInfo .class );
206+                         // First, check if this is actually a successful topic creation 
207+                         // (V2EX may return the topic page on success, which triggers error handler due to redirects) 
208+                         BaseInfo  resultInfo  = APIService .fruit ().fromHtml (s , TopicInfo .class );
209+                         if  (resultInfo .isValid ()) {
210+                             return  resultInfo ;
211+                         }
212+                         // If not a valid topic, try parsing as error pages 
213+                         resultInfo  = APIService .fruit ().fromHtml (s , CreateTopicPageInfo .class );
207214                        if  (!resultInfo .isValid ()) {
208215                            resultInfo  = APIService .fruit ().fromHtml (s , NewUserBannedCreateInfo .class );
209216                        }
@@ -212,7 +219,10 @@ public void handleError(GeneralError generalError) {
212219                    .subscribe (new  GeneralConsumer <BaseInfo >(this ) {
213220                        @ Override 
214221                        public  void  onConsume (BaseInfo  baseInfo ) {
215-                             if  (baseInfo  instanceof  CreateTopicPageInfo ) {
222+                             if  (baseInfo  instanceof  TopicInfo ) {
223+                                 // Actually a success! Treat it as such 
224+                                 onPostSuccess ((TopicInfo ) baseInfo );
225+                             } else  if  (baseInfo  instanceof  CreateTopicPageInfo ) {
216226                                onPostFailure ((CreateTopicPageInfo ) baseInfo );
217227                            } else  {
218228                                onBannedCreateTopic ((NewUserBannedCreateInfo ) baseInfo );
0 commit comments