Skip to content

Commit 2cfa205

Browse files
committed
change the word "Unable" to "Failed" in error messages
1 parent d72c306 commit 2cfa205

File tree

7 files changed

+39
-39
lines changed

7 files changed

+39
-39
lines changed

addons/nklbdev.importality/command_line_image_format_loader_extension.gd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ static var command_building_rules_for_custom_image_loader_project_setting: _Proj
99
func _get_recognized_extensions() -> PackedStringArray:
1010
var rules_by_extensions_result: _ProjectSetting.GettingValueResult = command_building_rules_for_custom_image_loader_project_setting.get_value()
1111
if rules_by_extensions_result.error:
12-
push_error("Unable to get command building rules for custom image loader project setting")
12+
push_error("Failed to get command building rules for custom image loader project setting")
1313
return PackedStringArray()
1414
var extensions: PackedStringArray
1515
for rule_string in rules_by_extensions_result.value:
1616
var parsed_rule: Dictionary = _parse_rule(rule_string)
1717
if parsed_rule.is_empty():
18-
push_error("Unable to parse command building rule")
18+
push_error("Failed to parse command building rule")
1919
return PackedStringArray()
2020
for extension in parsed_rule.extensions as PackedStringArray:
2121
if extensions.has(extension):
@@ -34,7 +34,7 @@ static func normalize_string(source: String) -> String:
3434
func _parse_rule(rule_string: String) -> Dictionary:
3535
var parts: PackedStringArray = rule_string.split(":", false, 1)
3636
if parts.size() != 2:
37-
push_error("Unable to find colon (:) delimiter in command building rule between file extensions and command template")
37+
push_error("Failed to find colon (:) delimiter in command building rule between file extensions and command template")
3838
return {}
3939
var extensions: PackedStringArray
4040
for extensions_splitted_by_spaces in normalize_string(parts[0]).split(" ", false):
@@ -60,19 +60,19 @@ func _load_image(
6060

6161
var temp_dir_path_result: _ProjectSetting.GettingValueResult = _Common.common_temporary_files_directory_path_project_setting.get_value()
6262
if temp_dir_path_result.error:
63-
push_error("Unable to get Temporary Files Directory Path to export image from source file: %s" % [temp_dir_path_result])
63+
push_error("Failed to get Temporary Files Directory Path to export image from source file: %s" % [temp_dir_path_result])
6464
return ERR_UNCONFIGURED
6565

6666
var rules_by_extensions_result: _ProjectSetting.GettingValueResult = command_building_rules_for_custom_image_loader_project_setting.get_value()
6767
if rules_by_extensions_result.error:
68-
push_error("Unable to get command building rules for custom image loader project setting")
68+
push_error("Failed to get command building rules for custom image loader project setting")
6969
return ERR_UNCONFIGURED
7070

7171
var command_templates_by_extensions: Dictionary
7272
for rule_string in rules_by_extensions_result.value:
7373
var parsed_rule: Dictionary = _parse_rule(rule_string)
7474
if parsed_rule.is_empty():
75-
push_error("Unable to parse command building rule")
75+
push_error("Failed to parse command building rule")
7676
return ERR_UNCONFIGURED
7777
for extension in parsed_rule.extensions as PackedStringArray:
7878
if command_templates_by_extensions.has(extension):
@@ -88,12 +88,12 @@ func _load_image(
8888

8989
var command_template: String = command_templates_by_extensions.get(extension, "") as String
9090
if command_template.is_empty():
91-
push_error("Unable to find command template for file extension: " + extension)
91+
push_error("Failed to find command template for file extension: " + extension)
9292
return ERR_UNCONFIGURED
9393

9494
var command_template_parts: PackedStringArray = _Common.split_words_with_quotes(command_template)
9595
if command_template_parts.is_empty():
96-
push_error("Unable to recognize command template parts for extension: %s" % [extension])
96+
push_error("Failed to recognize command template parts for extension: %s" % [extension])
9797
return ERR_UNCONFIGURED
9898

9999
for command_template_part_index in command_template_parts.size():
@@ -140,12 +140,12 @@ func _load_image(
140140

141141
var err: Error = image.load_png_from_buffer(FileAccess.get_file_as_bytes(global_output_path))
142142
if err:
143-
push_error("Unable to load temporary PNG file as image: %s" % [global_output_path])
143+
push_error("Failed to load temporary PNG file as image: %s" % [global_output_path])
144144
return err
145145

146146
err = DirAccess.remove_absolute(global_output_path)
147147
if err:
148-
push_warning("Unable to remove temporary file \"%s\". Continuing..." % [global_output_path])
148+
push_warning("Failed to remove temporary file \"%s\". Continuing..." % [global_output_path])
149149

150150
return OK
151151

addons/nklbdev.importality/export/aseprite.gd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
3030

3131
var os_command_result: _ProjectSetting.GettingValueResult = __os_command_project_setting.get_value()
3232
if os_command_result.error:
33-
result.fail(ERR_UNCONFIGURED, "Unable to get Aseprite Command to export spritesheet", os_command_result)
33+
result.fail(ERR_UNCONFIGURED, "Failed to get Aseprite Command to export spritesheet", os_command_result)
3434
return result
3535

3636
var os_command_arguments_result: _ProjectSetting.GettingValueResult = __os_command_arguments_project_setting.get_value()
3737
if os_command_arguments_result.error:
38-
result.fail(ERR_UNCONFIGURED, "Unable to get Aseprite Command Arguments to export spritesheet", os_command_arguments_result)
38+
result.fail(ERR_UNCONFIGURED, "Failed to get Aseprite Command Arguments to export spritesheet", os_command_arguments_result)
3939
return result
4040

4141
var temp_dir_path_result: _ProjectSetting.GettingValueResult = _Common.common_temporary_files_directory_path_project_setting.get_value()
4242
if temp_dir_path_result.error:
43-
result.fail(ERR_UNCONFIGURED, "Unable to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
43+
result.fail(ERR_UNCONFIGURED, "Failed to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
4444
return result
4545
var global_temp_dir_path: String = ProjectSettings.globalize_path(
4646
temp_dir_path_result.value.strip_edges())
4747

4848
if not DirAccess.dir_exists_absolute(global_temp_dir_path):
4949
err = DirAccess.make_dir_recursive_absolute(global_temp_dir_path)
5050
if err:
51-
result.fail(ERR_UNCONFIGURED, "Unable to create directory for temporary files \"%s\" with error %s \"%s\"" %
51+
result.fail(ERR_UNCONFIGURED, "Failed to create directory for temporary files \"%s\" with error %s \"%s\"" %
5252
[global_temp_dir_path, err, error_string(err)])
5353
return result
5454

@@ -81,7 +81,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
8181
var json = JSON.new()
8282
err = json.parse(FileAccess.get_file_as_string(global_json_path))
8383
if err:
84-
result.fail(ERR_INVALID_DATA, "Unable to parse sprite sheet json data with error %s \"%s\"" % [err, error_string(err)])
84+
result.fail(ERR_INVALID_DATA, "Failed to parse sprite sheet json data with error %s \"%s\"" % [err, error_string(err)])
8585
return result
8686
DirAccess.remove_absolute(global_json_path)
8787
var raw_sprite_sheet_data: Dictionary = json.data
@@ -150,7 +150,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
150150
tag_data.from,
151151
tag_data.to - tag_data.from + 1)
152152
if animation_params_parsing_result.error:
153-
result.fail(ERR_CANT_RESOLVE, "Unable to parse animation parameters",
153+
result.fail(ERR_CANT_RESOLVE, "Failed to parse animation parameters",
154154
animation_params_parsing_result)
155155
return result
156156
if unique_animations_names.has(animation_params_parsing_result.name):
@@ -236,7 +236,7 @@ class CustomImageFormatLoaderExtension:
236236
if not DirAccess.dir_exists_absolute(global_temp_dir_path):
237237
err = DirAccess.make_dir_recursive_absolute(global_temp_dir_path)
238238
if err:
239-
push_error("Unable to create directory for temporary files \"%s\" with error %s \"%s\"" %
239+
push_error("Failed to create directory for temporary files \"%s\" with error %s \"%s\"" %
240240
[global_temp_dir_path, err, error_string(err)])
241241
return ERR_QUERY_FAILED
242242

@@ -268,7 +268,7 @@ class CustomImageFormatLoaderExtension:
268268
var json = JSON.new()
269269
err = json.parse(FileAccess.get_file_as_string(global_json_path))
270270
if err:
271-
push_error("Unable to parse sprite sheet json data with error %s \"%s\"" % [err, error_string(err)])
271+
push_error("Failed to parse sprite sheet json data with error %s \"%s\"" % [err, error_string(err)])
272272
return ERR_INVALID_DATA
273273
DirAccess.remove_absolute(global_json_path)
274274
var raw_sprite_sheet_data: Dictionary = json.data

addons/nklbdev.importality/export/krita.gd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
3939

4040
var os_command_result: _ProjectSetting.GettingValueResult = __os_command_project_setting.get_value()
4141
if os_command_result.error:
42-
result.fail(ERR_UNCONFIGURED, "Unable to get Krita Command to export spritesheet", os_command_result)
42+
result.fail(ERR_UNCONFIGURED, "Failed to get Krita Command to export spritesheet", os_command_result)
4343
return result
4444

4545
var os_command_arguments_result: _ProjectSetting.GettingValueResult = __os_command_arguments_project_setting.get_value()
4646
if os_command_arguments_result.error:
47-
result.fail(ERR_UNCONFIGURED, "Unable to get Krita Command Arguments to export spritesheet", os_command_arguments_result)
47+
result.fail(ERR_UNCONFIGURED, "Failed to get Krita Command Arguments to export spritesheet", os_command_arguments_result)
4848
return result
4949

5050
var temp_dir_path_result: _ProjectSetting.GettingValueResult = _Common.common_temporary_files_directory_path_project_setting.get_value()
5151
if temp_dir_path_result.error:
52-
result.fail(ERR_UNCONFIGURED, "Unable to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
52+
result.fail(ERR_UNCONFIGURED, "Failed to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
5353
return result
5454
var global_temp_dir_path: String = ProjectSettings.globalize_path(temp_dir_path_result.value.strip_edges())
5555

@@ -58,7 +58,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
5858
var zip_reader: ZIPReader = ZIPReader.new()
5959
var zip_error: Error = zip_reader.open(global_source_file_path)
6060
if zip_error:
61-
result.fail(zip_error, "Unable to open Krita file \"%s\" as ZIP archive with error: %s (%s)" % [res_source_file_path, zip_error, error_string(zip_error)])
61+
result.fail(zip_error, "Failed to open Krita file \"%s\" as ZIP archive with error: %s (%s)" % [res_source_file_path, zip_error, error_string(zip_error)])
6262
return result
6363

6464
var files_names_in_zip: PackedStringArray = zip_reader.get_files()
@@ -127,7 +127,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
127127
story_xml_element.get_int("duration-frame") + \
128128
animation_framerate * story_xml_element.get_int("duration-second"))
129129
if animation_params_parsing_result.error:
130-
result.fail(ERR_CANT_RESOLVE, "Unable to parse animation parameters",
130+
result.fail(ERR_CANT_RESOLVE, "Failed to parse animation parameters",
131131
animation_params_parsing_result)
132132
return result
133133
if unique_animations_names.has(animation_params_parsing_result.name):
@@ -183,7 +183,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
183183
if not DirAccess.dir_exists_absolute(global_temp_dir_path):
184184
err = DirAccess.make_dir_recursive_absolute(global_temp_dir_path)
185185
if err:
186-
result.fail(ERR_QUERY_FAILED, "Unable to create directory temporary files \"%s\" with error %s \"%s\"" %
186+
result.fail(ERR_QUERY_FAILED, "Failed to create directory temporary files \"%s\" with error %s \"%s\"" %
187187
[global_temp_dir_path, err, error_string(err)])
188188
return result
189189
var global_temp_png_path_pattern: String = global_temp_dir_path.path_join(temp_png_file_name_pattern)

addons/nklbdev.importality/export/pencil2d.gd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
3131

3232
var os_command_result: _ProjectSetting.GettingValueResult = __os_command_project_setting.get_value()
3333
if os_command_result.error:
34-
result.fail(ERR_UNCONFIGURED, "Unable to get Pencil2D Command to export spritesheet", os_command_result)
34+
result.fail(ERR_UNCONFIGURED, "Failed to get Pencil2D Command to export spritesheet", os_command_result)
3535
return result
3636

3737
var os_command_arguments_result: _ProjectSetting.GettingValueResult = __os_command_arguments_project_setting.get_value()
3838
if os_command_arguments_result.error:
39-
result.fail(ERR_UNCONFIGURED, "Unable to get Pencil2D Command Arguments to export spritesheet", os_command_arguments_result)
39+
result.fail(ERR_UNCONFIGURED, "Failed to get Pencil2D Command Arguments to export spritesheet", os_command_arguments_result)
4040
return result
4141

4242
var temp_dir_path_result: _ProjectSetting.GettingValueResult = _Common.common_temporary_files_directory_path_project_setting.get_value()
4343
if temp_dir_path_result.error:
44-
result.fail(ERR_UNCONFIGURED, "Unable to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
44+
result.fail(ERR_UNCONFIGURED, "Failed to get Temporary Files Directory Path to export spritesheet", temp_dir_path_result)
4545
return result
4646

4747
var global_source_file_path: String = ProjectSettings.globalize_path(res_source_file_path)
4848

4949
var zip_reader: ZIPReader = ZIPReader.new()
5050
var zip_error: Error = zip_reader.open(global_source_file_path)
5151
if zip_error:
52-
result.fail(zip_error, "Unable to open Pencil2D file \"%s\" as ZIP archive with error: %s (%s)" % [res_source_file_path, zip_error, error_string(zip_error)])
52+
result.fail(zip_error, "Failed to open Pencil2D file \"%s\" as ZIP archive with error: %s (%s)" % [res_source_file_path, zip_error, error_string(zip_error)])
5353
return result
5454
var buffer: PackedByteArray = zip_reader.read_file("main.xml")
5555
var main_xml_root: _XML.XMLNodeRoot = _XML.parse_buffer(buffer)
@@ -74,7 +74,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
7474
AnimationOptions.FramesCount | AnimationOptions.Direction | AnimationOptions.RepeatCount,
7575
animation_first_frame_index)
7676
if animation_params_parsing_result.error:
77-
result.fail(ERR_CANT_RESOLVE, "Unable to parse animation parameters", animation_params_parsing_result)
77+
result.fail(ERR_CANT_RESOLVE, "Failed to parse animation parameters", animation_params_parsing_result)
7878
return result
7979
if unique_animations_names.has(animation_params_parsing_result.name):
8080
result.fail(ERR_INVALID_DATA, "Duplicated animation name \"%s\" at index: %s" %
@@ -97,7 +97,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
9797
if not DirAccess.dir_exists_absolute(global_temp_dir_path):
9898
err = DirAccess.make_dir_recursive_absolute(global_temp_dir_path)
9999
if err:
100-
result.fail(ERR_UNCONFIGURED, "Unable to create directory for temporary files \"%s\" with error %s \"%s\"" %
100+
result.fail(ERR_UNCONFIGURED, "Failed to create directory for temporary files \"%s\" with error %s \"%s\"" %
101101
[global_temp_dir_path, err, error_string(err)])
102102
var png_base_name: String = "temp"
103103
var global_temp_png_path: String = temp_dir_path_result.value.path_join("%s.png" % png_base_name)
@@ -129,7 +129,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
129129
.path_join("%s%04d.png" % [png_base_name, image_idx + 1])
130130
frames_images.push_back(Image.load_from_file(global_frame_png_path))
131131
var remove_frame_file_error: Error = DirAccess.remove_absolute(global_frame_png_path)
132-
if remove_frame_file_error: push_error("Unable to remove temp file: \"%s\" with error: %s %s, continuing..." %
132+
if remove_frame_file_error: push_error("Failed to remove temp file: \"%s\" with error: %s %s, continuing..." %
133133
[global_frame_png_path, remove_frame_file_error, error_string(remove_frame_file_error)])
134134

135135
var sprite_sheet_builder: _SpriteSheetBuilderBase = _create_sprite_sheet_builder(options)
@@ -218,7 +218,7 @@ class CustomImageFormatLoaderExtension:
218218
if not DirAccess.dir_exists_absolute(global_temp_dir_path):
219219
err = DirAccess.make_dir_recursive_absolute(global_temp_dir_path)
220220
if err:
221-
push_error("Unable to create directory for temporary files \"%s\" with error %s \"%s\"" %
221+
push_error("Failed to create directory for temporary files \"%s\" with error %s \"%s\"" %
222222
[global_temp_dir_path, err, error_string(err)])
223223
return ERR_QUERY_FAILED
224224
var png_base_name: String = "img"

addons/nklbdev.importality/export/piskel.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
2828
AnimationOptions.FramesCount | AnimationOptions.Direction | AnimationOptions.RepeatCount,
2929
animation_first_frame_index)
3030
if animation_params_parsing_result.error:
31-
result.fail(ERR_CANT_RESOLVE, "Unable to parse animation parameters", animation_params_parsing_result)
31+
result.fail(ERR_CANT_RESOLVE, "Failed to parse animation parameters", animation_params_parsing_result)
3232
return result
3333
if unique_animations_names.has(animation_params_parsing_result.name):
3434
result.fail(ERR_INVALID_DATA, "Duplicated animation name \"%s\" at index: %s" %

addons/nklbdev.importality/export/pixelorama.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
2121
if file == null or file.get_open_error() == ERR_FILE_UNRECOGNIZED:
2222
file = FileAccess.open(res_source_file_path, FileAccess.READ)
2323
if file == null:
24-
result.fail(ERR_FILE_CANT_OPEN, "Unable to open file with unknown error")
24+
result.fail(ERR_FILE_CANT_OPEN, "Failed to open file with unknown error")
2525
return result
2626
var open_error: Error = file.get_open_error()
2727
if open_error:
28-
result.fail(ERR_FILE_CANT_OPEN, "Unable to open file with error: %s \"%s\"" % [open_error, error_string(open_error)])
28+
result.fail(ERR_FILE_CANT_OPEN, "Failed to open file with error: %s \"%s\"" % [open_error, error_string(open_error)])
2929
return result
3030

3131
var first_line: String = file.get_line()
@@ -83,7 +83,7 @@ func _export(res_source_file_path: String, options: Dictionary) -> ExportResult:
8383
pxo_tag.name, AnimationOptions.Direction | AnimationOptions.RepeatCount,
8484
pxo_tag.from, animation_frames_count)
8585
if animation_params_parsing_result.error:
86-
result.fail(ERR_CANT_RESOLVE, "Unable to parse animation parameters",
86+
result.fail(ERR_CANT_RESOLVE, "Failed to parse animation parameters",
8787
animation_params_parsing_result)
8888
return result
8989
if unique_animations_names.has(animation_params_parsing_result.name):
@@ -179,11 +179,11 @@ class CustomImageFormatLoaderExtension:
179179
if file == null or file.get_open_error() == ERR_FILE_UNRECOGNIZED:
180180
file = FileAccess.open(file_access.get_path(), FileAccess.READ)
181181
if file == null:
182-
push_error("Unable to open file with unknown error")
182+
push_error("Failed to open file with unknown error")
183183
return ERR_FILE_CANT_OPEN
184184
var open_error: Error = file.get_open_error()
185185
if open_error:
186-
push_error("Unable to open file with error: %s \"%s\"" % [open_error, error_string(open_error)])
186+
push_error("Failed to open file with error: %s \"%s\"" % [open_error, error_string(open_error)])
187187
return ERR_FILE_CANT_OPEN
188188

189189
var first_line: String = file.get_line()

addons/nklbdev.importality/xml.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class XMLNodeElement:
9797
return true
9898
if raw_value.nocasecmp_to("False") == 0:
9999
return false
100-
push_warning("Unable to parse bool value from string: \"%s\", returning false..." % [raw_value])
100+
push_warning("Failed to parse bool value from string: \"%s\", returning false..." % [raw_value])
101101
return false
102102

103103
class XMLNodeText:

0 commit comments

Comments
 (0)