Skip to content

Commit

Permalink
changed to using super.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutton committed Sep 8, 2022
1 parent 73f1a3f commit 49be2c6
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions dcli_core/lib/src/functions/backup.dart
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,13 @@ String _backupFilePath(String pathToFile) {
class RestoreFileException extends DCliException {
/// Creates a [RestoreFileException] with the given
/// message.
RestoreFileException(String message) : super(message);
RestoreFileException(super.message);
}

/// Thrown by the [backupFile] function when
/// the file to be backed up is missing.
class BackupFileException extends DCliException {
/// Creates a [BackupFileException] with the given
/// message.
BackupFileException(String message) : super(message);
BackupFileException(super.message);
}
4 changes: 1 addition & 3 deletions dcli_core/lib/src/functions/cat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import 'dart:convert';
import 'dart:io';

import 'package:stack_trace/stack_trace.dart';

import '../../dcli_core.dart';

/// Prints the contents of the file located at [path] to stdout.
Expand Down Expand Up @@ -47,5 +45,5 @@ class Cat extends DCliFunction {
/// Thrown if the [cat] function encouters an error.
class CatException extends DCliFunctionException {
/// Thrown if the [cat] function encouters an error.
CatException(String reason, [Trace? stacktrace]) : super(reason, stacktrace);
CatException(super.reason, [super.stacktrace]);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/copy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ class _Copy extends DCliFunction {
/// Throw when the [copy] function encounters an error.
class CopyException extends DCliFunctionException {
/// Throw when the [copy] function encounters an error.
CopyException(String reason) : super(reason);
CopyException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/copy_tree.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,5 @@ class _CopyTree extends DCliFunction {
/// Throw when the [copy] function encounters an error.
class CopyTreeException extends DCliFunctionException {
/// Throw when the [copy] function encounters an error.
CopyTreeException(String reason) : super(reason);
CopyTreeException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/create_dir.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ class _CreateDir extends DCliFunction {
/// Thrown when the function [createDir] encounters an error
class CreateDirException extends DCliFunctionException {
/// Thrown when the function [createDir] encounters an error
CreateDirException(String reason) : super(reason);
CreateDirException(super.reason);
}
5 changes: 1 addition & 4 deletions dcli_core/lib/src/functions/dcli_function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Written by Brett Sutton <[email protected]>, Jan 2022
*/

import 'package:stack_trace/stack_trace.dart';

import '../util/dcli_exception.dart';

/// Base class for the classes that implement
Expand All @@ -15,6 +13,5 @@ class DCliFunction {}
/// Base class for all dcli function exceptions.
class DCliFunctionException extends DCliException {
/// Base class for all dcli function exceptions.
DCliFunctionException(String message, [Trace? stackTrace])
: super(message, stackTrace);
DCliFunctionException(super.message, [super.stackTrace]);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/delete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ class _Delete extends DCliFunction {
/// Thrown when the [delete] function encounters an error
class DeleteException extends DCliFunctionException {
/// Thrown when the [delete] function encounters an error
DeleteException(String reason) : super(reason);
DeleteException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/delete_dir.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ class _DeleteDir extends DCliFunction {
/// Throw when [deleteDir] function encounters an error
class DeleteDirException extends DCliFunctionException {
/// Throw when [deleteDir] function encounters an error
DeleteDirException(String reason) : super(reason);
DeleteDirException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/delete_tree.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,5 @@ class _DeleteTree extends DCliFunction {
/// Thrown when the [deleteTree] function encouters an error.
class DeleteTreeException extends DCliFunctionException {
/// Thrown when the [deleteTree] function encouters an error.
DeleteTreeException(String reason) : super(reason);
DeleteTreeException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -396,5 +396,5 @@ R withEnvironment<R>(R Function() callback,
/// Base class for all Environment variable related exceptions.
class EnvironmentException extends DCliException {
/// Create an environment variable exception.
EnvironmentException(String message) : super(message);
EnvironmentException(super.message);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/find.dart
Original file line number Diff line number Diff line change
Expand Up @@ -551,5 +551,5 @@ class FindItem {
/// Thrown when the [find] function encouters an error.
class FindException extends DCliFunctionException {
/// Thrown when the [move] function encouters an error.
FindException(String reason) : super(reason);
FindException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/head.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ class _Head extends DCliFunction {
/// Thrown if the [head] function encounters an error.
class HeadException extends DCliFunctionException {
/// Thrown if the [head] function encounters an error.
HeadException(String reason) : super(reason);
HeadException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/move.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ Future<void> _improveError(Object e, String from, String to) async {
/// Thrown when the [move] function encouters an error.
class MoveException extends DCliFunctionException {
/// Thrown when the [move] function encouters an error.
MoveException(String reason) : super(reason);
MoveException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/move_dir.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ class _MoveDir extends DCliFunction {
/// Thrown when the [moveDir] function encouters an error.
class MoveDirException extends DCliFunctionException {
/// Thrown when the [moveDir] function encouters an error.
MoveDirException(String reason) : super(reason);
MoveDirException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/move_tree.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,5 @@ class _MoveTree extends DCliFunction {
/// Thrown when the [moveTree] function encouters an error.
class MoveTreeException extends DCliFunctionException {
/// Thrown when the [moveTree] function encouters an error.
MoveTreeException(String reason) : super(reason);
MoveTreeException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/tail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ class _Tail extends DCliFunction {
/// thrown when the [tail] function encounters an exception
class TailException extends DCliFunctionException {
/// thrown when the [tail] function encounters an exception
TailException(String reason) : super(reason);
TailException(super.reason);
}
2 changes: 1 addition & 1 deletion dcli_core/lib/src/functions/touch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ class _Touch extends DCliFunction {
/// thrown when the [touch] function encounters an exception
class TouchException extends DCliFunctionException {
/// thrown when the [touch] function encounters an exception
TouchException(String reason) : super(reason);
TouchException(super.reason);
}

0 comments on commit 49be2c6

Please sign in to comment.