BigW Consortium Gitlab

Commit 6552c364 by Robert Speicher

Remove a redundant `InvalidPathError` definition

This is already defined in `ExtractsPath`, which this controller includes.
parent ecd1b816
...@@ -5,9 +5,6 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -5,9 +5,6 @@ class Projects::BlobController < Projects::ApplicationController
include RendersBlob include RendersBlob
include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::SanitizeHelper
# Raised when given an invalid file path
InvalidPathError = Class.new(StandardError)
prepend_before_action :authenticate_user!, only: [:edit] prepend_before_action :authenticate_user!, only: [:edit]
before_action :require_non_empty_project, except: [:new, :create] before_action :require_non_empty_project, except: [:new, :create]
...@@ -61,7 +58,6 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -61,7 +58,6 @@ class Projects::BlobController < Projects::ApplicationController
create_commit(Files::UpdateService, success_path: -> { after_edit_path }, create_commit(Files::UpdateService, success_path: -> { after_edit_path },
failure_view: :edit, failure_view: :edit,
failure_path: project_blob_path(@project, @id)) failure_path: project_blob_path(@project, @id))
rescue Files::UpdateService::FileChangedError rescue Files::UpdateService::FileChangedError
@conflict = true @conflict = true
render :edit render :edit
...@@ -132,7 +128,6 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -132,7 +128,6 @@ class Projects::BlobController < Projects::ApplicationController
def assign_blob_vars def assign_blob_vars
@id = params[:id] @id = params[:id]
@ref, @path = extract_ref(@id) @ref, @path = extract_ref(@id)
rescue InvalidPathError rescue InvalidPathError
render_404 render_404
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment