diff --git a/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj b/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj
index d98a38c..eb13dc1 100644
--- a/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj
+++ b/src/Backend/MyMusicLibrary.API/MyMusicLibrary.API.csproj
@@ -8,9 +8,9 @@
-
-
-
+
+
+
diff --git a/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj b/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj
index f90e4f1..1697a40 100644
--- a/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj
+++ b/src/Backend/MyMusicLibrary.Application/MyMusicLibrary.Application.csproj
@@ -13,8 +13,8 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
diff --git a/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs b/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs
index f283a74..d68fdcd 100644
--- a/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs
+++ b/src/Backend/MyMusicLibrary.Application/UseCases/Music/GetById/GetMusicByIdUseCase.cs
@@ -36,6 +36,9 @@ public async Task Execute(long id)
var musicUrl = await _s3Service.GetFileUrl(music.MusicKey!);
+ if(musicUrl is null)
+ throw new NotFoundException(ResourceMessagesException.MUSIC_URL_NOT_FOUND);
+
var musicMapper = _mapper.Map(music);
musicMapper.UrlMusicS3 = musicUrl.url;
diff --git a/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj b/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj
index 37984aa..b7c11a9 100644
--- a/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj
+++ b/src/Backend/MyMusicLibrary.Infrastructure/MyMusicLibrary.Infrastructure.csproj
@@ -12,16 +12,16 @@
-
-
+
+
-
-
-
+
+
+
diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs
index 0432da0..c8f07ea 100644
--- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs
+++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.Designer.cs
@@ -222,6 +222,15 @@ public static string MUSIC_NOT_BELONG_TO_USER {
}
}
+ ///
+ /// Looks up a localized string similar to URL does not exist..
+ ///
+ public static string MUSIC_URL_NOT_FOUND {
+ get {
+ return ResourceManager.GetString("MUSIC_URL_NOT_FOUND", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Name cannot be empty..
///
diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx
index 3c275de..386c399 100644
--- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx
+++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.pt-BR.resx
@@ -216,4 +216,7 @@
Você não tem permissão para acessar.
+
+ URL não encontrada.
+
\ No newline at end of file
diff --git a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx
index c278502..16db393 100644
--- a/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx
+++ b/src/Shared/MyMusicLibrary.Exceptions/ResourceMessagesException.resx
@@ -216,4 +216,7 @@
You do not have permission to access.
+
+ URL does not exist.
+
\ No newline at end of file