Test Setup Failed
Push — master ( 487d10...bc6199 )
by Steven
01:33
created

FileNotFoundException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 11
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 3 1
A to_s() 0 3 1
1
# frozen_string_literal: true
2
3
# class to implement a friendly exception for file not found rather than ErrNoEnt
4
class FileNotFoundException < StandardError
5
  attr_reader :file_name
6
7
  def initialize(file_name)
8
    @file_name = file_name
9
  end
10
11
  def to_s
12
    "#{I18n.t :file_not_found}: #{file_name}"
13
  end
14
end
15
16
# class to implement an exception for Missing Table Names in migrations
17
class MissingTableNameException < StandardError
18
  attr_reader :table_name
19
20
  def initialize(table_name)
21
    @table_name = table_name
22
  end
23
24
  def to_s
25
    "#{I18n.t :missing_table_name}: #{table_name}"
26
  end
27
end
28