Skip to content

Commit 0c60a37

Browse files
committed
refactor: return status instead of boolean on Publish
1 parent 26e726d commit 0c60a37

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/cls/IPM/Repo/IPublishService.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Class %IPM.Repo.IPublishService [ Abstract ]
22
{
33

4-
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean [ Abstract ]
4+
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status [ Abstract ]
55
{
66
}
77

src/cls/IPM/Repo/Remote/PublishService.cls

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
Class %IPM.Repo.Remote.PublishService Extends (%IPM.Repo.Remote.PackageService, %IPM.Repo.IPublishService)
22
{
33

4-
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
4+
Method PublishModule(pModule As %IPM.Repo.Remote.ModuleInfo) As %Status
55
{
6-
Quit ..Publish(pModule)
6+
Try {
7+
Do ..Publish(pModule)
8+
} Catch Ex {
9+
Return Ex.AsStatus()
10+
}
11+
Return $$$OK
712
}
813

9-
Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
14+
Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo)
1015
{
1116
If ((..Username="") || (..Password="")) && (..Token="") {
1217
$$$ThrowStatus($$$ERROR($$$GeneralError, "Publishing module, authorization required."))
@@ -28,7 +33,6 @@ Method Publish(pModule As %IPM.Repo.Remote.ModuleInfo) As %Boolean
2833
$$$ThrowStatus($$$ERROR($$$GeneralError, tMessage))
2934
}
3035
}
31-
Return 1
3236
}
3337

3438
Method CheckUnpublishEnabled(packageName As %String, packageVersion As %String) As %Boolean

0 commit comments

Comments
 (0)