修复:错误信息和code共同返回
This commit is contained in:
		
							parent
							
								
									9f8d0e4aac
								
							
						
					
					
						commit
						03f1c59391
					
				| 
						 | 
					@ -60,7 +60,10 @@ class ProjectsController < ApplicationController
 | 
				
			||||||
      OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(@project&.id, current_user.id)
 | 
					      OpenProjectDevOpsJob.set(wait: 5.seconds).perform_later(@project&.id, current_user.id)
 | 
				
			||||||
      UpdateProjectTopicJob.perform_later(@project.id) if @project.id.present?
 | 
					      UpdateProjectTopicJob.perform_later(@project.id) if @project.id.present?
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  rescue Exception => e
 | 
					  rescue Gitea::Api::ServerError => ex 
 | 
				
			||||||
 | 
					    uid_logger_error(ex.message)
 | 
				
			||||||
 | 
					    tip_exception(ex.http_code, ex.message)
 | 
				
			||||||
 | 
					  rescue ApplicationService::Error => e
 | 
				
			||||||
    uid_logger_error(e.message)
 | 
					    uid_logger_error(e.message)
 | 
				
			||||||
    tip_exception(e.message)
 | 
					    tip_exception(e.message)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,9 +26,6 @@ class Projects::CreateService < ApplicationService
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    @project
 | 
					    @project
 | 
				
			||||||
  rescue => e
 | 
					 | 
				
			||||||
    puts "create project service error: #{e.message}"
 | 
					 | 
				
			||||||
    raise Error, e.message
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,9 +33,6 @@ class Repositories::CreateService < ApplicationService
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      repository
 | 
					      repository
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  rescue => e
 | 
					 | 
				
			||||||
    puts "create repository service error: #{e.message}"
 | 
					 | 
				
			||||||
    raise Error, "服务器错误,请联系系统管理员!"
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue